Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7527329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:04:50+00:00 2026-05-30T04:04:50+00:00

I have some HTML/PHP code in Dreamweaver and for the life of me I

  • 0

I have some HTML/PHP code in Dreamweaver and for the life of me I cannot figure out the cause of this error. The error reads, “There is a syntax error on line 318. Code hinting may not work until you fix this error.” Could someone help? And yes, I know I have terrible commenting practice and variable nomenclature. The code can also be found here

<?php
require $_SERVER['DOCUMENT_ROOT'].'/resources/feeds.php';
require $_SERVER['DOCUMENT_ROOT'].'/resources/mysql.php';
session_start();
if(empty($_SESSION['username']) || $_SESSION['login'] != 'true'){ header("location:/"); }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License

Name       : Vegetables  
Description: A two-column, fixed-width design with dark color scheme.
Version    : 1.0
Released   : 20110416

-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="icon" type="/image/png" href="/resources/favicon.png">
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>My Website • Edit Information</title>
<link href="/style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<div id="header">
    <div id="logo">
      <h1><a href="/">My Website</a></h1>
        <a href="/">This is the best website ever</a>
      <p>&nbsp;</p>
</div>
</div>
<!-- end #header -->
<div id="wrapper">
    <div id="menu">
      <ul>
            <li class="current_page_item"><a href="/">Home</a></li>
            <li><a href="/events">Events</a></li>
            <li><a href="/forum">Forums</a></li>
            <li><a href="/about">About</a></li>
            <li><a href="/minutes">Minutes</a></li>
            <li><a href="/docs">Documents</a></li>
            <li><a href="/contact">Contact Us</a></li>
        </ul>
    </div>
    <!-- end #menu -->
</div>
<div id="page">
    <div id="content">
        <div class="post">
            <h2 class="title"><a href="#">Edit Information</a></h2>
            <div style="clear: both;"><form action="/admin"><input type="submit" value='Back'/></form></div>
<div style="clear: both;"></div>
            <div class="entry">

            <SCRIPT language="javascript">
            function add() {
                x++;
                var foo = document.getElementById('my_div');
                foo.innerHTML = foo.innerHTML +"<input type='text' name='tg"+x+"' placeholder='name'><br />";
            }
            function addch() {
                y++;
                var foo = document.getElementById('my_other_div');
                foo.innerHTML = foo.innerHTML +"<input type='text' name='ch"+y+"' placeholder='name'><br />";
            }
            function addws() {
                z++;
                var foo = document.getElementById('my_other_other_div');
                foo.innerHTML = foo.innerHTML +"<input type='text' name='ws"+z+"' placeholder='workshop name and leaders' style='width: 98%;'><br />";
            }
            function detect(form) {
                if(form.checked) {
                    window.backUpHtml = document.getElementById('con_div').innerHTML;   
                    document.getElementById('con_div').innerHTML = '';
                } else {
                    document.getElementById('con_div').innerHTML = window.backUpHtml;
                    window.backUpHtml = '';
                }
            }
            </SCRIPT>

             <form name="form1" method="post" action="./"><font color="#FFFFFF">
             <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#00000" style="max-width: 560px;">
             <tr>
             <td width="10%">Name</td>
             <td width="90%"><?php echo "<input name='name' type='text' value='".stripslashes($_POST['name'])."' required='required'/>"; ?><input type="checkbox" onclick="detect(this)" name="isyac" id="isyac" value="yes" <?php if(isset($_POST['isyac'])) { echo "checked='checked'";} ?> /><label for="isyac">YAC Meeting</label></td>
             </tr>
             <tr>
             <td width="10%" style="vertical-align:top;">Description</td>
             <td width="90%"><?php echo '<textarea name="desc" rows="5" cols="60" style="resize: vertical;" required="required">'.stripslashes($_POST["desc"]).'</textarea>'; ?></td>
             </tr>
             <tbody id="con_div">
             <!-- START OF CON DIV -->
             <tr>
             <td width="10%" style="vertical-align:top;">Touchgroup Leaders</td>
             <td width="90%">

             <?php 

             $blah = 1;

             while(isset($_POST['tg'.$blah])) {
                 echo '<input type="text" name="tg'.$blah.'" value="'.stripslashes($_POST["tg".$blah]).'" /><br />';
                 $blah++;
             }
             $hoo = $blah - 1;
             echo "<script language='javascript'> var x = ".$hoo."; </script>";

             ?>
             <div id="my_div"></div>
             <input type="button" value="Add" onClick="add()">

             </td>
             </tr>
             <tr>
             <td width="10%" style="vertical-align:top;">Chaplains</td>
             <td width="90%">

             <?php
              $blah = 1;

             while(isset($_POST['ch'.$blah])) {
                 echo '<input type="text" name="ch'.$blah.'" value="'.stripslashes($_POST["ch".$blah]).'" /><br />';
                 $blah++;
             }
             $hoo = $blah - 1;
             echo "<script language='javascript'> var y = ".$hoo."; </script>";

             ?>
             <div id="my_other_div"></div>
             <input type="button" value="Add" onClick="addch()">

             </td>
             </tr>
             <tr>
             <td width="10%" style="vertical-align:top;">Workshops</td>
             <td width="90%">

             <?php
              $blah = 1;

             while(isset($_POST['ws'.$blah])) {
                 echo '<input type="text" name="ws'.$blah.'" value="'.stripslashes($_POST["ws".$blah]).'" style="width: 98%;"/><br />';
                 $blah++;
             }
             $hoo = $blah - 1;
             echo "<script language='javascript'> var z = ".$hoo."; </script>";

             ?>
             <div id="my_other_other_div"></div>
             <input type="button" value="Add" onClick="addws()">

             </td>
             </tr>
             </tbody>
             <!-- END OF CON DIV -->
             <tr>
             <td width="10%" style="vertical-align:top;">Registration Links</td>
             <td width="90%">

             <?php echo '<input type="text" name="YouthLink" value="'.stripslashes($_POST['YouthLink']).'"/>&nbsp;Youth Link<br />
             <input type="text" name="AdultLink" value="'.stripslashes($_POST['AdultLink']).'"/>&nbsp;Adult Link'; ?>

             </td>
             </tr>
             <tr>
             <td width="10%" style="vertical-align:top;">Start Date</td>
             <td width="90%">

             <select name='startmonth'>
                <?php $idk = array("January","February","March","April","May","June","July","August","September","October","November","December"); 

                foreach ($idk as $bob):

                if($bob = $_POST['startmonth']) {
                    echo '<option value="'.$bob.'" selected="selected">'.$bob.'</option>';
                } else {
                    echo '<option value="'.$bob.'">'.$bob.'</option>';
                }

                endforeach;

                ?>
             </select>
             <select name="startday">
                <?php 

                $x = 1;
                while($x <= 31) {
                    if((int)$_POST['startday'] == $x) {
                        echo "<option value='".$x."' selected='selected'>".$x."</option>";
                    } else {
                        echo "<option value='".$x."'>".$x."</option>";
                    }
                    $x++;
                }

                ?>
             </select>
             <select name="startyear">
                <?php $date = getdate(); 
                for($x = 0;$x < 3;$x++) { 
                    $y = (int)$date['year']+$x;
                    if($y == $_POST['startyear']) {
                    echo "<option value='".$y."' selected='selected'>".$y."</option>";
                    } else {
                    echo "<option value='".$y."'>".$y."</option>"; 
                    }
                }
                ?>
             </select>

             </td>
             </tr>
             <tr>
             <td width="10%" style="vertical-align:top;">End Date</td>
             <td width="90%">

             <select name='endmonth'>
                <?php $idk = array("January","February","March","April","May","June","July","August","September","October","November","December"); 

                foreach ($idk as $bob):

                if($bob = $_POST['endmonth']) {
                    echo '<option value="'.$bob.'" selected="selected">'.$bob.'</option>';
                } else {
                    echo '<option value="'.$bob.'">'.$bob.'</option>';
                }

                endforeach;

                ?>
             </select>
             <select name="endday">
                <?php 

                $x = 1;
                while($x <= 31) {
                    if((int)$_POST['endday'] < $x) {
                        echo "<option value='".$x."'>".$x."</option>";
                    } else if((int)$_POST['endday'] == $x) {
                        echo "<option value='".$x."' selected='selected'>".$x."</option>";
                    } else if((int)$_POST['endday'] > $x) {
                        echo "<option value='".$x."'>".$x."</option>";
                    }
                    $x++;
                }

                ?>
             </select>
             <select name="endyear">
                <?php $date = getdate(); 
                for($x = 0;$x < 3;$x++) { 
                    $y = (int)$date['year']+$x;
                    if($y == $_POST['endyear']) {
                        echo "<option value='".$y."' selected='selected'>".$y."</option>";
                    } else {
                        echo "<option value='".$y."'>".$y."</option>"; 
                    } 
                }
                ?>
             </select>

             </td>
             </tr>
             <tr>
             <td width="10%" style="vertical-align:top;">Location</td>
             <td width="90%">

                <?php echo '<input type="text" name="location" value="'.stripslashes($_POST['location']).'" required="required"/>'; ?>

             </td>
             </tr>
             <tr>
             <td width="90%"></td>
             <td width="10%">

                <input type="hidden" name="blah" value="blah"/>
                <input type="submit" name="woohoo" value="Save" align="right"/>

             </td>
             </table>
             </form>
                 <?php if(isset($_POST['isyac'])) {
                echo "<script language='javascript'>window.backUpHtml = document.getElementById('con_div').innerHTML;   
                document.getElementById('con_div').innerHTML = '';</script>"; ?>
            }
            </div>

        </div>

<div style="clear: both;">&nbsp;</div>
    </div>
    <!-- end #content -->
    <div id="sidebar">
        <?php include($_SERVER['DOCUMENT_ROOT'].'/resources/side.php'); ?>
    </div>
    <!-- end #sidebar -->
    <div style="clear: both;">&nbsp;</div>
</div>
<!-- end #page -->
<div id="footer-menu">
    <ul>
            <li class="current_page_item"><a href="/">Home</a></li>
            <li><a href="/events">Events</a></li>
            <li><a href="/forum">Forums</a></li>
            <li><a href="/about">About</a></li>
            <li><a href="/minutes">Minutes</a></li>
            <li><a href="/docs">Documents</a></li>
            <li><a href="/contact">Contact Us</a></li>
  </ul>
</div>
<div id="footer">
    <p>Copyright &copy; <?php $date = getdate(); echo $date['year']; ?> My Website. All rights reserved.</p>
</div>
<!-- end #footer -->
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T04:04:54+00:00Added an answer on May 30, 2026 at 4:04 am

    Your problem comes from this bit of code:

                 <?php if(isset($_POST['isyac'])) {
                echo "<script language='javascript'>window.backUpHtml = document.getElementById('con_div').innerHTML;   
                document.getElementById('con_div').innerHTML = '';</script>"; ?>
            }
    

    the closing brace } needs to be inside the php tags (before the ?>)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this code in indexSucces.php //some html for the main page <td width='48%'
I have some PHP code that generates a calendar and then outputs html to
I have the following code: <?php if ($x == 1){ ?> <b>Some html...</b> <?php
I have a chunk of HTML code (with some PHP vars echoed inside of
Often when writing PHP I'll have it output some HTML like this - echo
I have some php code $_SESSION['username'] and I need to display it using html
I'm writing some php/html code. I have a css file that has several backgrounds.
Hi We have some php code using the file_get_contents() function, and I understand this
I have some php code that is creating an html table. Within it I
i have some HTML code saved in a PHP string $str = <font size=2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.