28 Replies Latest reply: Nov 14, 2012 5:35 AM by Reynold Dreamweaver CS6 RSS

    Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub

    Reynold Dreamweaver CS6 Community Member

      Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/public_html/Attendance.php on line 64

       

      How can I use Balance brace to identify with this parse error?

      Balance Braces.png

       

      The article was not clear how to use this functionality. Please advice. I have the above error message.

        • 1. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
          MurraySummers ACP/MVPs

          I don't think balance braces is going to be the right tool to use for this, simply because your visual scan of the code would be so much more effective.  Try this -

           

          1.  Do a source code search of the current document to look for "[".

          2.  For each location found, visually inspect the code to make sure that there is a required closing "]".

           

          You should find it in a hurry.

           

          Balance braces only "balances" the innermost set of 'braces' starting from the cursor insertion point.

          • 2. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
            Reynold Dreamweaver CS6 Community Member

            Hi Murray,

            Thanks for your reply. Could you expalian? I have used the source code. How do I do a source search for the "[" square bracket? Sounds naff but it will be helpful (for optimum debugging purposes to have the square balance brackets utility)

            Please advise

            • 3. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
              MurraySummers ACP/MVPs

              You could always use regular expressions to search the entire page for all instances of "[" that are NOT followed by "]", but you'd have to be very crafty with regular expressions to formulate that search expression - I am not.

               

              My approach would be to use DW's Find and Replace tool to find all "[" in the current document. This will generate a list of hits in the search log. Double click each entry and visually inspect the code at that location to find the element that is improperly terminated.

               

              My actual approach would be just to visually scan down the page to see where the error is, but if your eye is not accustomed to looking at this kind of code, it may be easier to use the Search tool.

              • 4. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
                Reynold Dreamweaver CS6 Community Member

                Regular Expression - Just reading it, mulling over it for the time being.

                 

                Search Find and Replace works. Helpful if there was line number against these logs.

                 

                My eyes? At the moment they are not accustomed.

                 

                Will paste for completeness; to see how you tackle this.

                <?php require_once('Connections/attending.php');?>

                <?php

                if (!function_exists("GetSQLValueString")) {

                function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

                {

                  if (PHP_VERSION < 6) {

                    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

                  }

                 

                 

                  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

                 

                 

                  switch ($theType) {

                    case "text":

                      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

                      break;   

                    case "long":

                    case "int":

                      $theValue = ($theValue != "") ? intval($theValue) : "NULL";

                      break;

                    case "double":

                      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";

                      break;

                    case "date":

                      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

                      break;

                    case "defined":

                      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;

                      break;

                  }

                  return $theValue;

                }

                }

                 

                 

                mysql_select_db($database_attending, $attending);

                $query_rsattend = "SELECT * FROM attendlist ORDER BY surname ASC";

                $rsattend = mysql_query($query_rsattend, $attending) or die(mysql_error());

                $row_rsattend = mysql_fetch_assoc($rsattend);

                $totalRows_rsattend = mysql_num_rows($rsattend);

                 

                 

                $editFormAction = $_SERVER['PHP_SELF'];

                if (isset($_SERVER['QUERY_STRING'])) {

                  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);

                }

                 

                 

                if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {

                  $insertSQL = sprintf("INSERT INTO attendlist (Windowsid, title, firstname, surname, extension, mobile, jobrole, course, cpg, mgrname, room, Adate) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",

                                       GetSQLValueString($_POST['Wid'], "text"),

                                       GetSQLValueString($_POST['title'], "text"),

                                       GetSQLValueString($_POST['firstname'], "text"),

                                       GetSQLValueString($_POST['surname'], "text"),

                                       GetSQLValueString($_POST['contactno'], "text"),

                                       GetSQLValueString($_POST['mobile'], "text"),

                                       GetSQLValueString($_POST['jobrole'], "text"),

                                       GetSQLValueString($_POST['courses'], "text"),

                                       GetSQLValueString($_POST['cpg2'], "text"),

                                       GetSQLValueString($_POST['mgrname2'], "text"),

                                       GetSQLValueString($_POST['troom'], "text"),

                                       GetSQLValueString($_POST['Adate2'], "date"));

                 

                 

                  mysql_select_db($database_attending, $attending);

                  $Result1 = mysql_query($insertSQL, $attending) or die(mysql_error());

                 

                 

                  $insertGoTo = "Listing.php";

                  if (isset($_SERVER['QUERY_STRING'])) {

                    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";

                    $insertGoTo .= $_SERVER['QUERY_STRING'];

                  }

                  header(sprintf("Location: %s", $insertGoTo));

                }

                 

                 

                if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {

                  $insertSQL = sprintf("INSERT INTO attendlist (title, firstname, surname, extension, mobile, jobrole, course, cpg, mgrname, room, Adate) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",

                                       GetSQLValueString($_POST['title'], "text"),

                                       GetSQLValueString($_POST['firstname'], "text"),

                                       GetSQLValueString($_POST['surname'], "text"),

                                       GetSQLValueString($_POST['contactno'], "text"),

                                       GetSQLValueString($_POST['mobile'], "text"),

                                       GetSQLValueString($_POST['jobrole'], "text"),

                                       GetSQLValueString($_POST['courses'], "text"),

                                       GetSQLValueString($_POST['cpg2'], "text"),

                                       GetSQLValueString($_POST['mgrname2'], "text"),

                                       GetSQLValueString($_POST['troom'], "text"),

                                       GetSQLValueString($_POST['Adate2'], "date"));

                 

                 

                  mysql_select_db($database_attending, $attending);

                  $Result1 = mysql_query($insertSQL, $attending) or die(mysql_error());

                 

                 

                  $insertGoTo = "Listing.php";

                  if (isset($_SERVER['QUERY_STRING'])) {

                    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";

                    $insertGoTo .= $_SERVER['QUERY_STRING'];

                  }

                  header(sprintf("Location: %s", $insertGoTo));

                } ?>

                 

                 

                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

                <html xmlns="http://www.w3.org/1999/xhtml">

                <head>

                <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

                <title>Register</title>

                <style type="text/css">

                <!--

                body {

                          font: 100%/0.8 Verdana, Arial, Helvetica, sans-serif;

                          background-color: #4E5869;

                          margin: 0;

                          padding: 0;

                          color: #000;

                }

                 

                 

                /* ~~ Element/tag selectors ~~ */

                ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */

                          padding: 0;

                          margin: 0;

                }

                h1, h2, h3, h4, h5, h6, p {

                          margin-top: 0;           /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */

                          padding-right: 15px;

                          padding-left: 15px; /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */

                }

                a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */

                          border: none;

                }

                 

                 

                /* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */

                a:link {

                          color:#414958;

                          text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */

                }

                a:visited {

                          color: #4E5869;

                          text-decoration: underline;

                }

                a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */

                          text-decoration: none;

                }

                 

                 

                /* ~~ this container surrounds all other divs giving them their percentage-based width ~~ */

                .container {

                          width: 80%;

                          max-width: 960px;/* a max-width may be desirable to keep this layout from getting too wide on a large monitor. This keeps line length more readable. IE6 does not respect this declaration. */

                          min-width: 780px;/* a min-width may be desirable to keep this layout from getting too narrow. This keeps line length more readable in the side columns. IE6 does not respect this declaration. */

                          background-color: #FFF;

                          margin: 0 auto; /* the auto value on the sides, coupled with the width, centers the layout. It is not needed if you set the .container's width to 100%. */

                }

                 

                 

                /* ~~the header is not given a width. It will extend the full width of your layout. It contains an image placeholder that should be replaced with your own linked logo~~ */

                .header {

                          background-color: #6F7D94;

                }

                 

                 

                /* ~~ This is the layout information. ~~

                 

                 

                1) Padding is only placed on the top and/or bottom of the div. The elements within this div have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the div itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design.

                 

                 

                */

                .content {

                          padding: 10px 0;

                }

                 

                 

                /* ~~ This grouped selector gives the lists in the .content area space ~~ */

                .content ul, .content ol {

                          padding: 0 15px 15px 40px; /* this padding mirrors the right padding in the headings and paragraph rule above. Padding was placed on the bottom for space between other elements on the lists and on the left to create the indention. These may be adjusted as you wish. */

                }

                 

                 

                /* ~~ The footer ~~ */

                .footer {

                          padding: 10px 0;

                          background-color: #6F7D94;

                }

                 

                 

                /* ~~ miscellaneous float/clear classes ~~ */

                .fltrt {  /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */

                          float: right;

                          margin-left: 8px;

                }

                .fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */

                          float: left;

                          margin-right: 8px;

                }

                .clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the #footer is removed or taken out of the #container */

                          clear:both;

                          height:0;

                          font-size: 1px;

                          line-height: 0px;

                }

                -->

                </style>

                <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />

                <link href="SpryAssets/SpryValidationSelect.css" rel="stylesheet" type="text/css" />

                <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>

                <script src="SpryAssets/SpryValidationSelect.js" type="text/javascript"></script>

                <script language='JavaScript' type='text/javascript' src='TSScript/yahoo.js'></script>

                <script language='JavaScript' type='text/javascript' src='TSScript/event.js'></script>

                <script language='JavaScript' type='text/javascript' src='TSScript/dom.js'></script>

                <script language='JavaScript' type='text/javascript' src='TSScript/calendar.js'></script>

                <link rel='stylesheet' type='text/css' href='TSScript/TSCalendar/calendar.css' />

                <script language='JavaScript' type='text/javascript' src='TSScript/TSCalendar/TSCalendar.js'></script>

                </head>

                <body>

                <div class="container">

                  <div class="header"><!-- end .header --><img src="Cerner At Imperial2.jpg" width="960" height="150" alt="" /></div>

                  <div class="content">

                    <h3>Attendance Register: </h3><?php

                $Todaystime = mktime(0,0,0,date("d"),date("m"),date("Y"));

                echo "Date  ".date("d/m/Y", $Todaystime);

                ?>

                    </h3>

                    <form action="<?php echo $editFormAction; ?>" id="form1" name="form1" method="POST">

                      <table width="780" border="0" cellspacing="10" summary="Cerner@Imperial">

                      

                        <tr>

                          <td><div align="right">* User ID</div></td>

                          <td colspan="2"><span id="sprytextfield1">

                            <input name="Wid" type="text" id="Wid" tabindex="1" size="18" maxlength="10" />

                          <span class="textfieldRequiredMsg"> a value is required.</span></span></td>

                          <td> </td>

                        </tr>

                        <tr>

                          <td><div align="right">* Title</div></td>

                          <td colspan="2"><span id="spryselect1">

                            <select name="title" id="title" tabindex="2">

                              <option value="0">Select</option>

                              <option value="Ms">Ms</option>

                              <option value="Mrs">Mrs</option>

                              <option value="Mdm">Mdm</option>

                              <option value="Mr">Mr</option>

                              <option value="Dr">Dr</option>

                              <option value="Professor">Prof</option>

                            </select>

                <span class="selectRequiredMsg">    Please select an item.</span></span></td>

                          <td> </td>

                        </tr>

                        <tr>

                          <td><div align="right">* First name</div></td>

                          <td colspan="2"><span id="sprytextfield2">

                            <input name="firstname" type="text" id="firstname" tabindex="3" size="40" maxlength="30" />

                          <span class="textfieldRequiredMsg"> a value is required.</span></span></td>

                          <td> </td>

                        </tr>

                        <tr>

                          <td><div align="right">* Surname</div></td>

                          <td colspan="2"><span id="sprytextfield5">

                            <input name="surname" type="text" id="surname" tabindex="4" size="40" maxlength="30" />

                          <span class="textfieldRequiredMsg"> a value is required.</span></span></td>

                          <td> </td>

                        </tr>

                        <tr>

                          <td><div align="right">* Contact/ Bleep</div></td>

                          <td colspan="2"><span id="sprytextfield3">

                            <input name="contactno" type="text" id="contactno" tabindex="5" size="10" maxlength="6" />

                          <span class="textfieldRequiredMsg">a value is required.</span></span></td>

                          <td> </td>

                        </tr>

                        <tr>

                          <td><div align="right">Mobile (optional)</div></td>

                          <td colspan="2"><input name="mobile" type="text" id="mobile" tabindex="6" size="25" maxlength="18" />          <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></td>

                          <td> </td>

                        </tr>

                        <tr>

                          <td> </td>

                          <td colspan="2"> </td>

                          <td> </td>

                        </tr>

                        <tr>

                          <td><div align="right">* Job role</div></td>

                          <td colspan="2"><span id="spryselect2">

                            <select name="jobrole" id="jobrole" tabindex="7">

                              <option value="0">Select</option>

                              <option value="Doctor">Doctor</option>

                              <option value="CNS/NP">CNS/NP</option>

                              <option value="Midwife">Midwife</option>

                              <option value="Other Staff">Other Staff</option>

                              <option value="Nurse IP HCA">Nurse IP &amp; HCA</option>

                              <option value="Nurse OP HCA">Nurse OP &amp; HCA</option>

                              <option value="IP Physician Assitant">IP Physician Assistant</option>

                              <option value="OP Phlebotomist">OP Phlebotmist</option>

                              <option value="Pharmacists">Pharmacists</option>

                              <option value="Therapist AHP">Therapist &amp; AHP</option>

                              <option value="Medical Secretary">Medical Secretary</option>

                              <option value="Bed Manager">Bed Manager</option>

                              <option value="Medical Record Staff">Medical Records</option>

                              <option value="Medical Records Manager">Medical Records Mgr</option>

                              <option value="OP Booking Clerk">OP Booking Clerk</option>

                              <option value="OP Receptionist">OP Receptionist</option>

                              <option value="ED Admin">ED Admin</option>

                              <option value="Ward Administrator">Ward Administrator</option>

                              <option value="IP Wait List Clerk/Mgr">IP Wait List Clerk/Mgr</option>

                              <option value="Antenatal Supervisor">Antenatal Supervisor</option>

                              <option value="Clinical Coder">Clinical Coder</option>

                              <option value="Clinical Coding Mgr">Clinical Coding Mgr</option>

                              <option value="Pi Help Desk Backoffice">Pi Help Desk Analyst/Back Office</option>

                            </select>

                          <span class="selectInvalidMsg">Please select a valid item.</span></span></td>

                          <td> </td>

                        </tr>

                        <tr>

                          <td><div align="right">* Manager's Name</div></td>

                          <td colspan="2"><span id="sprytextfield4">

                          <input name="mgrname2" type="text" id="mgrname2" tabindex="8" size="40" maxlength="30" />

                          <span class="textfieldRequiredMsg"> a value is required.</span></span></td>

                          <td> </td>

                        </tr>

                        <tr>

                      

                          <td><div align="right">* Date of attendance</div></td>

                          <td colspan="2">

                            <span id="sprytextfield6">

                           

                            <input name="Adate2" type="text" id="Adate2" tabindex="9" />

                            <span class="textfieldRequiredMsg"> a value is required.</span><span class="textfieldInvalidFormatMsg"> invalid format.</span></span>

                </td>

                          <td> </td>

                        </tr>

                        <tr>

                          <td> </td>

                          <td colspan="2"> </td>

                          <td> </td>

                        </tr>

                        <tr>

                          <td><div align="right">* Course</div></td>

                          <td colspan="2"><span id="spryselect3">

                            <select name="courses" id="courses" form="form1" tabindex="10" title="course">

                              <option value="0">Select</option>

                              <option value="Doctors">Doctors</option>

                              <option value="Nurse IP">Nurse IP</option>

                              <option value="Nurse OP">Nurse OP</option>

                              <option value="Midwife">Midwife</option>

                              <option value="HCA">HCA</option>

                              <option value="Pharmacist">Pharmacist</option>

                              <option value="Back Office Staff">Back Office Staff</option>

                              <option value="AHP">AHP</option>

                              <option value="Pi Help Desk Analyst">Pi Help Desk Analyst</option>

                              <option value="Medical Secretary">Medical Secretary</option>

                              <option value="OP Phlebotmist">OP Phlebotmist</option>

                              <option value="Champion Users Doctors">Champion Users Doctors</option>

                              <option value="Champion Users Nurse IP">Champion Users Nurse IP</option>

                            </select>

                          <span class="selectRequiredMsg">Please select an item.</span></span></td>

                          <td> </td>

                        </tr>

                        <tr>

                          <td><div align="right">* Training Location </div></td>

                          <td><span id="spryselect4">

                            <select name="troom" required="required" id="troom" form="form1" tabindex="11" title="location">

                              <option value="0">Select</option>

                              <option value="CXH">Charing Cross</option>

                              <option value="HH">Hammersmith Hammersmith</option>

                              <option value="QEH">Queen Charlottee Hospital</option>

                              <option value="SMH">St Mary's Hospital</option>

                              <option value="WEH">Western Eye Hospital</option>

                              <option value="SCC">St Charles Community</option>

                            </select>

                          <span class="selectRequiredMsg">Please select an item.</span></span></td>

                         

                          <td> </td>

                          <td> </td>

                        </tr>

                        <tr>

                          <td><div align="right">* CPG</div></td>

                          <td><span id="spryselect5">

                            <select name="cpg2" required="required" id="cpg2" form="form1" tabindex="12" title="cpg">

                              <option value="0">Select</option>

                              <option value="CPG 1 Medicine">CPG1 - Medicine</option>

                              <option value="CPG 2 Surgery &amp; Cancer">CPG2 - Surgery and Cancer</option>

                              <option value="CPG3 Specialist Services">CPG3 - Specialist Services</option>

                              <option value="CPG4 Circulatory Services and Renal Medicine">CPG4 - Circulatory Services and Renal Medicine</option>

                              <option value="CPG5 Womens and Childrens">CPG5 - Womens and Childrens</option>

                              <option value="CPG6 Clinical and Investigative Sciences">CPG6 - Clinical and Investigative Sciences</option>

                              <option value="CP7 Private Patients">CPG7 - Private Patients</option>

                              <option value="Others">Others</option>

                            </select>

                          <span class="selectRequiredMsg">Please select an item.</span></span></td>

                          <td> </td>

                          <td> </td>

                        </tr>

                        <tr>

                          <td> </td>

                          <td><input type="submit" name="submitbt" id="submitbt" value="Submit" /></td>

                          <td> </td>

                          <td> </td>

                        </tr>

                        <tr>

                          <td> </td>

                          <td colspan="2"> </td>

                          <td> </td>

                        </tr>

                        <tr>

                          <td><div align="center">* Mandatory Fields</div></td>

                          <td colspan="2"> </td>

                          <td> </td>

                        </tr>

                        <tr>

                          <td> </td>

                          <td colspan="2"> </td>

                          <td> </td>

                        </tr>

                        <tr>

                          <td> </td>

                          <td colspan="2"> </td>

                          <td> </td>

                        </tr>

                      </table>

                      <input type="hidden" name="MM_insert" value="form1" />

                    </form>

                    <p> </p>

                    <p> </p>

                    <!-- end .content --></div>

                  <div class="footer"></div>

                <script type="text/javascript">

                var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn:["blur", "change"]});

                var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {validateOn:["blur", "change"]});

                var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "none", {validateOn:["blur", "change"]});

                var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "none", {validateOn:["blur", "change"]});

                var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "integer", {validateOn:["blur", "change"]});

                var spryselect2 = new Spry.Widget.ValidationSelect("spryselect2", {invalidValue:"-1", isRequired:false, validateOn:["blur", "change"]});

                var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "none", {validateOn:["blur"]});

                var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "none", {validateOn:["blur", "change"]});

                var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6", "date", {validateOn:["change"], format:"dd/mm/yyyy"});

                var spryselect3 = new Spry.Widget.ValidationSelect("spryselect3");

                var spryselect4 = new Spry.Widget.ValidationSelect("spryselect4");

                var spryselect5 = new Spry.Widget.ValidationSelect("spryselect5", {validateOn:["blur", "change"]});

                </script>

                </body>

                </html>

                <?php

                mysql_free_result($rsattend);

                ?>

                • 5. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
                  MurraySummers ACP/MVPs

                  Are you sure that is the correct page?  There are 44 instances of "[" and 44 instances of "]" so I don't see a missing one. Does the error message give a line #?

                  • 6. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
                    MurraySummers ACP/MVPs

                    Also it's a little puzzling why you have two instances of the insertion code on the page, although the second instance will never be executed.

                     

                    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {

                      $insertSQL = sprintf("INSERT INTO attendlist (Windowsid, title, firstname, surname, extension, mobile, jobrole, course, cpg, mgrname, room, Adate) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",

                                           GetSQLValueString($_POST['Wid'], "text"),

                                           GetSQLValueString($_POST['title'], "text"),

                                           GetSQLValueString($_POST['firstname'], "text"),

                                           GetSQLValueString($_POST['surname'], "text"),

                                           GetSQLValueString($_POST['contactno'], "text"),

                                           GetSQLValueString($_POST['mobile'], "text"),

                                           GetSQLValueString($_POST['jobrole'], "text"),

                                           GetSQLValueString($_POST['courses'], "text"),

                                           GetSQLValueString($_POST['cpg2'], "text"),

                                           GetSQLValueString($_POST['mgrname2'], "text"),

                                           GetSQLValueString($_POST['troom'], "text"),

                                           GetSQLValueString($_POST['Adate2'], "date"));

                     

                     

                      mysql_select_db($database_attending, $attending);

                      $Result1 = mysql_query($insertSQL, $attending) or die(mysql_error());

                     

                     

                      $insertGoTo = "Listing.php";

                      if (isset($_SERVER['QUERY_STRING'])) {

                        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";

                        $insertGoTo .= $_SERVER['QUERY_STRING'];

                      }

                      header(sprintf("Location: %s", $insertGoTo));

                    }

                     

                     

                    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {

                      $insertSQL = sprintf("INSERT INTO attendlist (title, firstname, surname, extension, mobile, jobrole, course, cpg, mgrname, room, Adate) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",

                                           GetSQLValueString($_POST['title'], "text"),

                                           GetSQLValueString($_POST['firstname'], "text"),

                                           GetSQLValueString($_POST['surname'], "text"),

                                           GetSQLValueString($_POST['contactno'], "text"),

                                           GetSQLValueString($_POST['mobile'], "text"),

                                           GetSQLValueString($_POST['jobrole'], "text"),

                                           GetSQLValueString($_POST['courses'], "text"),

                                           GetSQLValueString($_POST['cpg2'], "text"),

                                           GetSQLValueString($_POST['mgrname2'], "text"),

                                           GetSQLValueString($_POST['troom'], "text"),

                                           GetSQLValueString($_POST['Adate2'], "date"));

                     

                     

                      mysql_select_db($database_attending, $attending);

                      $Result1 = mysql_query($insertSQL, $attending) or die(mysql_error());

                     

                     

                      $insertGoTo = "Listing.php";

                      if (isset($_SERVER['QUERY_STRING'])) {

                        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";

                        $insertGoTo .= $_SERVER['QUERY_STRING'];

                      }

                      header(sprintf("Location: %s", $insertGoTo));

                     

                    Finally, you are inserting data into the database without sanitizing it properly to prevent SQL injection - are you sure you want to do this?

                    • 7. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
                      Reynold Dreamweaver CS6 Community Member

                      Hi

                      Yes, the error line is 64 as in the subject title. I am British. So what did you mean by "...database without sanitizing it properly to prevent SQL injection" mean. I am not sure how the two instances of the code are within the page. I can see now there are 2 instances after you have drawn this to my attention.

                       

                      Its line 64,

                      No intention of have 2 instances.

                      Sanitazed?

                       

                      Thanks

                      • 8. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
                        MurraySummers ACP/MVPs

                        I just don't see anything on this page that would cause that error to be thrown.  Do you see the error message as soon as the page loads, or only after submitting the form?  Is the test data actually inserted into the database?

                         

                        By the way, to read about sanitizing user input, Google "php sanitize sql injection".  There are several good links there.

                        • 9. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
                          Reynold Dreamweaver CS6 Community Member

                          Hi,

                          At runtime it produces an error;

                           

                          Parse error:  syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/public_html/Attendance.php on line 64

                          • 11. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
                            MurraySummers ACP/MVPs

                            Before submit?  So as soon as you load the page you get the error?

                             

                            Here is your page - http://www.gws-sandbox.com/test-parse.php

                             

                            I have commented out the include link to the connection file at the top, the database selection block lines 37-41, and the free result block at the bottom below the </html>, in other words, only that code dealing with connecting to the database and fetching the results.  As far as I can tell this modified page does not throw an error when it loads (you can't submit anything though or you will get errors reflecting the missing database connection).

                             

                            So, unless I am mistaken and the error is in some of the code I have commented out, this means that the error would have to be in your connection file that is included at line 1 of the page.  How many lines of code are in that file (Connections/attending.php)?

                            • 12. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
                              Reynold Dreamweaver CS6 Community Member

                              Hello Murray,

                              Thank you for your lateral thinking. The attending.php file consits of the following lines of code.

                              <?php

                              # FileName="Connection_php_mysql.htm"

                              # Type="MYSQL"

                              # HTTP="true"

                              $hostname_attending =

                              $database_attending =

                              $username_attending =

                              $password_attending =

                              $attending = mysql_pconnect($hostname_attending, $username_attending, $password_attending) or trigger_error(mysql_error(),E_USER_ERROR);

                              ?>

                               

                              I have taken out details to the database and reference to the domain name. These are lines of code included (require_once). Everything else remains untouched.

                               

                              So I take it that there are 2 issues. 1 issue is you suspect that the error is within the code above. Second issue about sanatize the code. I am unclear about the second issue. Does this mean that the auto-code generation is out of date with todays' security issues with code injections by hackers.

                               

                              Please advise.

                              • 13. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
                                Reynold Dreamweaver CS6 Community Member

                                Hi Murray,

                                Whlist you was away I was doing some reflection on the parse error, as above. Following on, I put together a diagram and tried to understand where the problem lies.

                                Here is the diagram from your write-up.

                                Attendance PHP.jpg

                                At Line 1, I have changed the code to <?php require_once('../Connections/attendance.php'); ?>. This cured the parse error of Line 64 (as in error message).

                                 

                                Further questions which leads me to think of the site definition, under the server band. Definition of remote server and testing server. I am back tracking and thinking about this. Let me know about your thoughts. Thanks.

                                • 14. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
                                  MurraySummers ACP/MVPs

                                  At Line 1, I have changed the code to <?php require_once('../Connections/attendance.php'); ?>.

                                   

                                  Wait - that cured your error?  So in your site, the attendance page is one folder level below the root folder?  That would certainly suggest that your site definition is bad, and it places all your other links under suspicion.  Anyhow, the parse error message you were getting would certainly NOT suggest to me that the problem was that the include file could not be found. Are you sure about this?

                                  • 15. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
                                    Reynold Dreamweaver CS6 Community Member

                                    Hi Murray,

                                    I discovered under the database panel, the database disappeared when it cured the parse error. So, I put it back and the database reappeared and there was a red exclaimation mark against the record. So back to square 1, Click the submit button the completed data form stayed where it is and no writing to the database.

                                     

                                    I am going to write this first then I am going to upload the file in question.

                                     

                                    Thanks.

                                    • 16. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
                                      MurraySummers ACP/MVPs

                                      Clearly you need to resolve your pathing/site definition problems first.

                                      • 17. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
                                        Reynold Dreamweaver CS6 Community Member

                                        Hi

                                        Okay,

                                        when I save the file it does not upload a copy of the file to the server but I can test the server and database and it makes a connection successfully.

                                         

                                        So site definition then it should upload and refreshed to the saved working copy?

                                         

                                        I am going to run by you the site definition if that is okay with you. Thanks

                                        • 19. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
                                          Reynold Dreamweaver CS6 Community Member

                                          <?php require_once('Connections/attending.php');?>

                                          <?php

                                          if (!function_exists("GetSQLValueString")) {

                                          function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

                                          {

                                            if (PHP_VERSION < 6) {

                                              $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

                                            }

                                           

                                           

                                            $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

                                           

                                           

                                            switch ($theType) {

                                              case "text":

                                                $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

                                                break;   

                                              case "long":

                                              case "int":

                                                $theValue = ($theValue != "") ? intval($theValue) : "NULL";

                                                break;

                                              case "double":

                                                $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";

                                                break;

                                              case "date":

                                                $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

                                                break;

                                              case "defined":

                                                $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;

                                                break;

                                            }

                                            return $theValue;

                                          }

                                          }

                                           

                                           

                                          $editFormAction = $_SERVER['PHP_SELF'];

                                          if (isset($_SERVER['QUERY_STRING'])) {

                                            $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);

                                          }

                                           

                                           

                                          if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {

                                            $insertSQL = sprintf("INSERT INTO attendlist (Windowsid, title, firstname, surname, extension, mobile, jobrole, course, cpg, mgrname, room) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",

                                                                 GetSQLValueString($_POST['Wid'], "text"),

                                                                 GetSQLValueString($_POST['title'], "text"),

                                                                 GetSQLValueString($_POST['firstname'], "text"),

                                                                 GetSQLValueString($_POST['surname'], "text"),

                                                                 GetSQLValueString($_POST['contactno'], "text"),

                                                                 GetSQLValueString($_POST['mobile'], "text"),

                                                                 GetSQLValueString($_POST['jobrole'], "text"),

                                                                 GetSQLValueString($_POST['courses'], "text"),

                                                                 GetSQLValueString($_POST['cpg2'], "text"),

                                                                 GetSQLValueString($_POST['mgrname2'], "text"),

                                                                 GetSQLValueString($_POST['troom'], "text"));

                                           

                                           

                                            mysql_select_db($database_attending, $attending);

                                            $Result1 = mysql_query($insertSQL, $attending) or die(mysql_error());

                                           

                                           

                                            $insertGoTo = "ReportbyAll.php";

                                            if (isset($_SERVER['QUERY_STRING'])) {

                                              $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";

                                              $insertGoTo .= $_SERVER['QUERY_STRING'];

                                            }

                                            header(sprintf("Location: %s", $insertGoTo));

                                          }

                                           

                                           

                                          mysql_select_db($database_attending, $attending);

                                          $query_rsattendance = "SELECT * FROM attendlist";

                                          $rsattendance = mysql_query($query_rsattendance, $attending) or die(mysql_error());

                                          $row_rsattendance = mysql_fetch_assoc($rsattendance);

                                          $totalRows_rsattendance = mysql_num_rows($rsattendance);

                                           

                                           

                                          if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {

                                            $insertSQL = sprintf("INSERT INTO attendlist (title, firstname, surname, extension, mobile, jobrole, course, cpg, mgrname, room, Adate) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",

                                                                 GetSQLValueString($_POST['title'], "text"),

                                                                 GetSQLValueString($_POST['firstname'], "text"),

                                                                 GetSQLValueString($_POST['surname'], "text"),

                                                                 GetSQLValueString($_POST['contactno'], "text"),

                                                                 GetSQLValueString($_POST['mobile'], "text"),

                                                                 GetSQLValueString($_POST['jobrole'], "text"),

                                                                 GetSQLValueString($_POST['courses'], "text"),

                                                                 GetSQLValueString($_POST['cpg2'], "text"),

                                                                 GetSQLValueString($_POST['mgrname2'], "text"),

                                                                 GetSQLValueString($_POST['troom'], "text"),

                                                                 GetSQLValueString($_POST['Adate2'], "date"));

                                           

                                           

                                            mysql_select_db($database_attending, $attending);

                                            $Result1 = mysql_query($insertSQL, $attending) or die(mysql_error());

                                           

                                           

                                            $insertGoTo = "Listing.php";

                                            if (isset($_SERVER['QUERY_STRING'])) {

                                              $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";

                                              $insertGoTo .= $_SERVER['QUERY_STRING'];

                                            }

                                            header(sprintf("Location: %s", $insertGoTo));

                                          } ?>

                                           

                                           

                                          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

                                          <html xmlns="http://www.w3.org/1999/xhtml">

                                          <head>

                                          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

                                          <title>Register</title>

                                          <style type="text/css">

                                          <!--

                                          body {

                                                    font: 100%/0.8 Verdana, Arial, Helvetica, sans-serif;

                                                    background-color: #4E5869;

                                                    margin: 0;

                                                    padding: 0;

                                                    color: #000;

                                          }

                                           

                                           

                                          /* ~~ Element/tag selectors ~~ */

                                          ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */

                                                    padding: 0;

                                                    margin: 0;

                                          }

                                          h1, h2, h3, h4, h5, h6, p {

                                                    margin-top: 0;           /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */

                                                    padding-right: 15px;

                                                    padding-left: 15px; /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */

                                          }

                                          a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */

                                                    border: none;

                                          }

                                           

                                           

                                          /* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */

                                          a:link {

                                                    color:#414958;

                                                    text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */

                                          }

                                          a:visited {

                                                    color: #4E5869;

                                                    text-decoration: underline;

                                          }

                                          a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */

                                                    text-decoration: none;

                                          }

                                           

                                           

                                          /* ~~ this container surrounds all other divs giving them their percentage-based width ~~ */

                                          .container {

                                                    width: 80%;

                                                    max-width: 960px;/* a max-width may be desirable to keep this layout from getting too wide on a large monitor. This keeps line length more readable. IE6 does not respect this declaration. */

                                                    min-width: 780px;/* a min-width may be desirable to keep this layout from getting too narrow. This keeps line length more readable in the side columns. IE6 does not respect this declaration. */

                                                    background-color: #FFF;

                                                    margin: 0 auto; /* the auto value on the sides, coupled with the width, centers the layout. It is not needed if you set the .container's width to 100%. */

                                          }

                                           

                                           

                                          /* ~~the header is not given a width. It will extend the full width of your layout. It contains an image placeholder that should be replaced with your own linked logo~~ */

                                          .header {

                                                    background-color: #6F7D94;

                                          }

                                           

                                           

                                          /* ~~ This is the layout information. ~~

                                           

                                           

                                          1) Padding is only placed on the top and/or bottom of the div. The elements within this div have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the div itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design.

                                           

                                           

                                          */

                                          .content {

                                                    padding: 10px 0;

                                          }

                                           

                                           

                                          /* ~~ This grouped selector gives the lists in the .content area space ~~ */

                                          .content ul, .content ol {

                                                    padding: 0 15px 15px 40px; /* this padding mirrors the right padding in the headings and paragraph rule above. Padding was placed on the bottom for space between other elements on the lists and on the left to create the indention. These may be adjusted as you wish. */

                                          }

                                           

                                           

                                          /* ~~ The footer ~~ */

                                          .footer {

                                                    padding: 10px 0;

                                                    background-color: #6F7D94;

                                          }

                                           

                                           

                                          /* ~~ miscellaneous float/clear classes ~~ */

                                          .fltrt {  /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */

                                                    float: right;

                                                    margin-left: 8px;

                                          }

                                          .fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */

                                                    float: left;

                                                    margin-right: 8px;

                                          }

                                          .clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the #footer is removed or taken out of the #container */

                                                    clear:both;

                                                    height:0;

                                                    font-size: 1px;

                                                    line-height: 0px;

                                          }

                                          -->

                                          </style>

                                          <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />

                                          <link href="SpryAssets/SpryValidationSelect.css" rel="stylesheet" type="text/css" />

                                          <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>

                                          <script src="SpryAssets/SpryValidationSelect.js" type="text/javascript"></script>

                                          <script language='JavaScript' type='text/javascript' src='TSScript/yahoo.js'></script>

                                          <script language='JavaScript' type='text/javascript' src='TSScript/event.js'></script>

                                          <script language='JavaScript' type='text/javascript' src='TSScript/dom.js'></script>

                                          <script language='JavaScript' type='text/javascript' src='TSScript/calendar.js'></script>

                                          <link rel='stylesheet' type='text/css' href='TSScript/TSCalendar/calendar.css' />

                                          <script language='JavaScript' type='text/javascript' src='TSScript/TSCalendar/TSCalendar.js'></script>

                                          </head>

                                          <body>

                                          <div class="container">

                                            <div class="header"><!-- end .header --><img src="Cerner At Imperial2.jpg" width="960" height="150" alt="" /></div>

                                            <div class="content">

                                              <h3>Attendance Register: </h3>

                                                    <?php 

                                                    echo "Date  ".date("d/m/Y");?>

                                              </h3>

                                              <form action="<?php echo $editFormAction; ?>" id="form1" name="form1" method="POST">

                                                <table width="780" border="0" cellspacing="10" summary="Cerner@Imperial">

                                                

                                                  <tr>

                                                    <td><div align="right">* User ID</div></td>

                                                    <td colspan="2"><span id="sprytextfield1">

                                                      <input name="Wid" type="text" id="Wid" tabindex="1" size="18" maxlength="10" />

                                                    <span class="textfieldRequiredMsg"> a value is required.</span></span></td>

                                                    <td> </td>

                                                  </tr>

                                                  <tr>

                                                    <td><div align="right">* Title</div></td>

                                                    <td colspan="2"><span id="spryselect1">

                                                      <select name="title" id="title" tabindex="2">

                                                        <option value="0">Select</option>

                                                        <option value="Ms">Ms</option>

                                                        <option value="Mrs">Mrs</option>

                                                        <option value="Mdm">Mdm</option>

                                                        <option value="Mr">Mr</option>

                                                        <option value="Dr">Dr</option>

                                                        <option value="Professor">Prof</option>

                                                      </select>

                                          <span class="selectRequiredMsg">    Please select an item.</span></span></td>

                                                    <td> </td>

                                                  </tr>

                                                  <tr>

                                                    <td><div align="right">* First name</div></td>

                                                    <td colspan="2"><span id="sprytextfield2">

                                                      <input name="firstname" type="text" id="firstname" tabindex="3" size="40" maxlength="30" />

                                                    <span class="textfieldRequiredMsg"> a value is required.</span></span></td>

                                                    <td> </td>

                                                  </tr>

                                                  <tr>

                                                    <td><div align="right">* Surname</div></td>

                                                    <td colspan="2"><span id="sprytextfield5">

                                                      <input name="surname" type="text" id="surname" tabindex="4" size="40" maxlength="30" />

                                                    <span class="textfieldRequiredMsg"> a value is required.</span></span></td>

                                                    <td> </td>

                                                  </tr>

                                                  <tr>

                                                    <td><div align="right">* Contact/ Bleep</div></td>

                                                    <td colspan="2"><span id="sprytextfield3">

                                                      <input name="contactno" type="text" id="contactno" tabindex="5" size="10" maxlength="6" />

                                                    <span class="textfieldRequiredMsg">a value is required.</span></span></td>

                                                    <td> </td>

                                                  </tr>

                                                  <tr>

                                                    <td><div align="right">Mobile (optional)</div></td>

                                                    <td colspan="2"><input name="mobile" type="text" id="mobile" tabindex="6" size="25" maxlength="18" />          <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></td>

                                                    <td> </td>

                                                  </tr>

                                                  <tr>

                                                    <td> </td>

                                                    <td colspan="2"> </td>

                                                    <td> </td>

                                                  </tr>

                                                  <tr>

                                                    <td><div align="right">* Job role</div></td>

                                                    <td colspan="2"><span id="spryselect2">

                                                      <select name="jobrole" id="jobrole" tabindex="7">

                                                        <option value="0">Select</option>

                                                        <option value="Doctor">Doctor</option>

                                                        <option value="CNS/NP">CNS/NP</option>

                                                        <option value="Midwife">Midwife</option>

                                                        <option value="Other Staff">Other Staff</option>

                                                        <option value="Nurse IP HCA">Nurse IP &amp; HCA</option>

                                                        <option value="Nurse OP HCA">Nurse OP &amp; HCA</option>

                                                        <option value="IP Physician Assitant">IP Physician Assistant</option>

                                                        <option value="OP Phlebotomist">OP Phlebotmist</option>

                                                        <option value="Pharmacists">Pharmacists</option>

                                                        <option value="Therapist AHP">Therapist &amp; AHP</option>

                                                        <option value="Medical Secretary">Medical Secretary</option>

                                                        <option value="Bed Manager">Bed Manager</option>

                                                        <option value="Medical Record Staff">Medical Records</option>

                                                        <option value="Medical Records Manager">Medical Records Mgr</option>

                                                        <option value="OP Booking Clerk">OP Booking Clerk</option>

                                                        <option value="OP Receptionist">OP Receptionist</option>

                                                        <option value="ED Admin">ED Admin</option>

                                                        <option value="Ward Administrator">Ward Administrator</option>

                                                        <option value="IP Wait List Clerk/Mgr">IP Wait List Clerk/Mgr</option>

                                                        <option value="Antenatal Supervisor">Antenatal Supervisor</option>

                                                        <option value="Clinical Coder">Clinical Coder</option>

                                                        <option value="Clinical Coding Mgr">Clinical Coding Mgr</option>

                                                        <option value="Pi Help Desk Backoffice">Pi Help Desk Analyst/Back Office</option>

                                                      </select>

                                                    <span class="selectInvalidMsg">Please select a valid item.</span></span></td>

                                                    <td> </td>

                                                  </tr>

                                                  <tr>

                                                    <td><div align="right">* Manager's Name</div></td>

                                                    <td colspan="2"><span id="sprytextfield4">

                                                    <input name="mgrname2" type="text" id="mgrname2" tabindex="8" size="40" maxlength="30" />

                                                    <span class="textfieldRequiredMsg"> a value is required.</span></span></td>

                                                    <td> </td>

                                                  </tr>

                                                  <tr>

                                                

                                                    <td><div align="right"></div></td>

                                                    <td colspan="2"> </td>

                                                    <td> </td>

                                                  </tr>

                                                  <tr>

                                                    <td> </td>

                                                    <td colspan="2"> </td>

                                                    <td> </td>

                                                  </tr>

                                                  <tr>

                                                    <td><div align="right">* Course</div></td>

                                                    <td colspan="2"><span id="spryselect3">

                                                      <select name="courses" id="courses" form="form1" tabindex="10" title="course">

                                                        <option value="0">Select</option>

                                                        <option value="Doctors">Doctors</option>

                                                        <option value="Nurse IP">Nurse IP</option>

                                                        <option value="Nurse OP">Nurse OP</option>

                                                        <option value="Midwife">Midwife</option>

                                                        <option value="HCA">HCA</option>

                                                        <option value="Pharmacist">Pharmacist</option>

                                                        <option value="Back Office Staff">Back Office Staff</option>

                                                        <option value="AHP">AHP</option>

                                                        <option value="Pi Help Desk Analyst">Pi Help Desk Analyst</option>

                                                        <option value="Medical Secretary">Medical Secretary</option>

                                                        <option value="OP Phlebotmist">OP Phlebotmist</option>

                                                        <option value="Champion Users Doctors">Champion Users Doctors</option>

                                                        <option value="Champion Users Nurse IP">Champion Users Nurse IP</option>

                                                      </select>

                                                    <span class="selectRequiredMsg">Please select an item.</span></span></td>

                                                    <td> </td>

                                                  </tr>

                                                  <tr>

                                                    <td><div align="right">* Training Location </div></td>

                                                    <td><span id="spryselect4">

                                                      <select name="troom" required="required" id="troom" form="form1" tabindex="11" title="location">

                                                        <option value="0">Select</option>

                                                        <option value="CXH">Charing Cross</option>

                                                        <option value="HH">Hammersmith Hammersmith</option>

                                                        <option value="QEH">Queen Charlottee Hospital</option>

                                                        <option value="SMH">St Mary's Hospital</option>

                                                        <option value="WEH">Western Eye Hospital</option>

                                                        <option value="SCC">St Charles Community</option>

                                                      </select>

                                                    <span class="selectRequiredMsg">Please select an item.</span></span></td>

                                                   

                                                    <td> </td>

                                                    <td> </td>

                                                  </tr>

                                                  <tr>

                                                    <td><div align="right">* CPG</div></td>

                                                    <td><span id="spryselect5">

                                                      <select name="cpg2" required="required" id="cpg2" form="form1" tabindex="12" title="cpg">

                                                        <option value="0">Select</option>

                                                        <option value="CPG 1 Medicine">CPG1 - Medicine</option>

                                                        <option value="CPG 2 Surgery &amp; Cancer">CPG2 - Surgery and Cancer</option>

                                                        <option value="CPG3 Specialist Services">CPG3 - Specialist Services</option>

                                                        <option value="CPG4 Circulatory Services and Renal Medicine">CPG4 - Circulatory Services and Renal Medicine</option>

                                                        <option value="CPG5 Womens and Childrens">CPG5 - Womens and Childrens</option>

                                                        <option value="CPG6 Clinical and Investigative Sciences">CPG6 - Clinical and Investigative Sciences</option>

                                                        <option value="CP7 Private Patients">CPG7 - Private Patients</option>

                                                        <option value="Others">Others</option>

                                                      </select>

                                                    <span class="selectRequiredMsg">Please select an item.</span></span></td>

                                                    <td> </td>

                                                    <td> </td>

                                                  </tr>

                                                  <tr>

                                                    <td> </td>

                                                    <td><input type="submit" name="submitbt" id="submitbt" value="Submit" /></td>

                                                    <td> </td>

                                                    <td> </td>

                                                  </tr>

                                                  <tr>

                                                    <td> </td>

                                                    <td colspan="2"> </td>

                                                    <td> </td>

                                                  </tr>

                                                  <tr>

                                                    <td><div align="center">* Mandatory Fields</div></td>

                                                    <td colspan="2"> </td>

                                                    <td> </td>

                                                  </tr>

                                                  <tr>

                                                    <td> </td>

                                                    <td colspan="2"> </td>

                                                    <td> </td>

                                                  </tr>

                                                  <tr>

                                                    <td> </td>

                                                    <td colspan="2"> </td>

                                                    <td> </td>

                                                  </tr>

                                                </table>

                                                <input type="hidden" name="MM_insert" value="form1" />

                                              </form>

                                              <p> </p>

                                              <p> </p>

                                              <!-- end .content --></div>

                                            <div class="footer"></div>

                                          <script type="text/javascript">

                                          var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn:["blur", "change"]});

                                          var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {validateOn:["blur", "change"]});

                                          var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "none", {validateOn:["blur", "change"]});

                                          var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "none", {validateOn:["blur", "change"]});

                                          var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "integer", {validateOn:["blur", "change"]});

                                          var spryselect2 = new Spry.Widget.ValidationSelect("spryselect2", {invalidValue:"-1", isRequired:false, validateOn:["blur", "change"]});

                                          var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "none", {validateOn:["blur"]});

                                          var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "none", {validateOn:["blur", "change"]});

                                          var spryselect3 = new Spry.Widget.ValidationSelect("spryselect3");

                                          var spryselect4 = new Spry.Widget.ValidationSelect("spryselect4");

                                          var spryselect5 = new Spry.Widget.ValidationSelect("spryselect5", {validateOn:["blur", "change"]});

                                          </script>

                                          </body>

                                          </html>

                                          <?php

                                          mysql_free_result($rsattendance);

                                          ?>

                                          • 20. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
                                            Reynold Dreamweaver CS6 Community Member

                                            <?php require_once('Connections/attending.php');?>
                                            <?php
                                            if (!function_exists("GetSQLValueString")) {
                                            function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
                                            {
                                              if (PHP_VERSION < 6) {
                                                $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
                                              }

                                              $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

                                              switch ($theType) {
                                                case "text":
                                                  $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
                                                  break;   
                                                case "long":
                                                case "int":
                                                  $theValue = ($theValue != "") ? intval($theValue) : "NULL";
                                                  break;
                                                case "double":
                                                  $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
                                                  break;
                                                case "date":
                                                  $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
                                                  break;
                                                case "defined":
                                                  $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
                                                  break;
                                              }
                                              return $theValue;
                                            }
                                            }

                                            $editFormAction = $_SERVER['PHP_SELF'];
                                            if (isset($_SERVER['QUERY_STRING'])) {
                                              $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
                                            }

                                            if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
                                              $insertSQL = sprintf("INSERT INTO attendlist (Windowsid, title, firstname, surname, extension, mobile, jobrole, course, cpg, mgrname, room) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                                                                   GetSQLValueString($_POST['Wid'], "text"),
                                                                   GetSQLValueString($_POST['title'], "text"),
                                                                   GetSQLValueString($_POST['firstname'], "text"),
                                                                   GetSQLValueString($_POST['surname'], "text"),
                                                                   GetSQLValueString($_POST['contactno'], "text"),
                                                                   GetSQLValueString($_POST['mobile'], "text"),
                                                                   GetSQLValueString($_POST['jobrole'], "text"),
                                                                   GetSQLValueString($_POST['courses'], "text"),
                                                                   GetSQLValueString($_POST['cpg2'], "text"),
                                                                   GetSQLValueString($_POST['mgrname2'], "text"),
                                                                   GetSQLValueString($_POST['troom'], "text"));

                                              mysql_select_db($database_attending, $attending);
                                              $Result1 = mysql_query($insertSQL, $attending) or die(mysql_error());

                                              $insertGoTo = "ReportbyAll.php";
                                              if (isset($_SERVER['QUERY_STRING'])) {
                                                $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
                                                $insertGoTo .= $_SERVER['QUERY_STRING'];
                                              }
                                              header(sprintf("Location: %s", $insertGoTo));
                                            }

                                            mysql_select_db($database_attending, $attending);
                                            $query_rsattendance = "SELECT * FROM attendlist";
                                            $rsattendance = mysql_query($query_rsattendance, $attending) or die(mysql_error());
                                            $row_rsattendance = mysql_fetch_assoc($rsattendance);
                                            $totalRows_rsattendance = mysql_num_rows($rsattendance);

                                            if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
                                              $insertSQL = sprintf("INSERT INTO attendlist (title, firstname, surname, extension, mobile, jobrole, course, cpg, mgrname, room, Adate) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                                                                   GetSQLValueString($_POST['title'], "text"),
                                                                   GetSQLValueString($_POST['firstname'], "text"),
                                                                   GetSQLValueString($_POST['surname'], "text"),
                                                                   GetSQLValueString($_POST['contactno'], "text"),
                                                                   GetSQLValueString($_POST['mobile'], "text"),
                                                                   GetSQLValueString($_POST['jobrole'], "text"),
                                                                   GetSQLValueString($_POST['courses'], "text"),
                                                                   GetSQLValueString($_POST['cpg2'], "text"),
                                                                   GetSQLValueString($_POST['mgrname2'], "text"),
                                                                   GetSQLValueString($_POST['troom'], "text"),
                                                                   GetSQLValueString($_POST['Adate2'], "date"));

                                              mysql_select_db($database_attending, $attending);
                                              $Result1 = mysql_query($insertSQL, $attending) or die(mysql_error());

                                              $insertGoTo = "Listing.php";
                                              if (isset($_SERVER['QUERY_STRING'])) {
                                                $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
                                                $insertGoTo .= $_SERVER['QUERY_STRING'];
                                              }
                                              header(sprintf("Location: %s", $insertGoTo));
                                            } ?>

                                            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                                            <html xmlns="http://www.w3.org/1999/xhtml">
                                            <head>
                                            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                                            <title>Register</title>
                                            <style type="text/css">
                                            <!--
                                            body {
                                            font: 100%/0.8 Verdana, Arial, Helvetica, sans-serif;
                                            background-color: #4E5869;
                                            margin: 0;
                                            padding: 0;
                                            color: #000;
                                            }

                                            /* ~~ Element/tag selectors ~~ */
                                            ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */
                                            padding: 0;
                                            margin: 0;
                                            }
                                            h1, h2, h3, h4, h5, h6, p {
                                            margin-top: 0;  /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */
                                            padding-right: 15px;
                                            padding-left: 15px; /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */
                                            }
                                            a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */
                                            border: none;
                                            }

                                            /* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */
                                            a:link {
                                            color:#414958;
                                            text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */
                                            }
                                            a:visited {
                                            color: #4E5869;
                                            text-decoration: underline;
                                            }
                                            a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */
                                            text-decoration: none;
                                            }

                                            /* ~~ this container surrounds all other divs giving them their percentage-based width ~~ */
                                            .container {
                                            width: 80%;
                                            max-width: 960px;/* a max-width may be desirable to keep this layout from getting too wide on a large monitor. This keeps line length more readable. IE6 does not respect this declaration. */
                                            min-width: 780px;/* a min-width may be desirable to keep this layout from getting too narrow. This keeps line length more readable in the side columns. IE6 does not respect this declaration. */
                                            background-color: #FFF;
                                            margin: 0 auto; /* the auto value on the sides, coupled with the width, centers the layout. It is not needed if you set the .container's width to 100%. */
                                            }

                                            /* ~~the header is not given a width. It will extend the full width of your layout. It contains an image placeholder that should be replaced with your own linked logo~~ */
                                            .header {
                                            background-color: #6F7D94;
                                            }

                                            /* ~~ This is the layout information. ~~

                                            1) Padding is only placed on the top and/or bottom of the div. The elements within this div have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the div itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design.

                                            */
                                            .content {
                                            padding: 10px 0;
                                            }

                                            /* ~~ This grouped selector gives the lists in the .content area space ~~ */
                                            .content ul, .content ol {
                                            padding: 0 15px 15px 40px; /* this padding mirrors the right padding in the headings and paragraph rule above. Padding was placed on the bottom for space between other elements on the lists and on the left to create the indention. These may be adjusted as you wish. */
                                            }

                                            /* ~~ The footer ~~ */
                                            .footer {
                                            padding: 10px 0;
                                            background-color: #6F7D94;
                                            }

                                            /* ~~ miscellaneous float/clear classes ~~ */
                                            .fltrt {  /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
                                            float: right;
                                            margin-left: 8px;
                                            }
                                            .fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */
                                            float: left;
                                            margin-right: 8px;
                                            }
                                            .clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the #footer is removed or taken out of the #container */
                                            clear:both;
                                            height:0;
                                            font-size: 1px;
                                            line-height: 0px;
                                            }
                                            -->
                                            </style>
                                            <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
                                            <link href="SpryAssets/SpryValidationSelect.css" rel="stylesheet" type="text/css" />
                                            <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
                                            <script src="SpryAssets/SpryValidationSelect.js" type="text/javascript"></script>
                                            <script language='JavaScript' type='text/javascript' src='TSScript/yahoo.js'></script>
                                            <script language='JavaScript' type='text/javascript' src='TSScript/event.js'></script>
                                            <script language='JavaScript' type='text/javascript' src='TSScript/dom.js'></script>
                                            <script language='JavaScript' type='text/javascript' src='TSScript/calendar.js'></script>
                                            <link rel='stylesheet' type='text/css' href='TSScript/TSCalendar/calendar.css' />
                                            <script language='JavaScript' type='text/javascript' src='TSScript/TSCalendar/TSCalendar.js'></script>
                                            </head>
                                            <body>
                                            <div class="container">
                                              <div class="header"><!-- end .header --><img src="Cerner At Imperial2.jpg" width="960" height="150" alt="" /></div>
                                              <div class="content">
                                                <h3>Attendance Register: </h3>
                                            <?php 
                                            echo "Date  ".date("d/m/Y");?>
                                                </h3>
                                                <form action="<?php echo $editFormAction; ?>" id="form1" name="form1" method="POST">
                                                  <table width="780" border="0" cellspacing="10" summary="Cerner@Imperial">
                                                  
                                                    <tr>
                                                      <td><div align="right">* User ID</div></td>
                                                      <td colspan="2"><span id="sprytextfield1">
                                                        <input name="Wid" type="text" id="Wid" tabindex="1" size="18" maxlength="10" />
                                                      <span class="textfieldRequiredMsg"> a value is required.</span></span></td>
                                                      <td> </td>
                                                    </tr>
                                                    <tr>
                                                      <td><div align="right">* Title</div></td>
                                                      <td colspan="2"><span id="spryselect1">
                                                        <select name="title" id="title" tabindex="2">
                                                          <option value="0">Select</option>
                                                          <option value="Ms">Ms</option>
                                                          <option value="Mrs">Mrs</option>
                                                          <option value="Mdm">Mdm</option>
                                                          <option value="Mr">Mr</option>
                                                          <option value="Dr">Dr</option>
                                                          <option value="Professor">Prof</option>
                                                        </select>
                                            <span class="selectRequiredMsg">    Please select an item.</span></span></td>
                                                      <td> </td>
                                                    </tr>
                                                    <tr>
                                                      <td><div align="right">* First name</div></td>
                                                      <td colspan="2"><span id="sprytextfield2">
                                                        <input name="firstname" type="text" id="firstname" tabindex="3" size="40" maxlength="30" />
                                                      <span class="textfieldRequiredMsg"> a value is required.</span></span></td>
                                                      <td> </td>
                                                    </tr>
                                                    <tr>
                                                      <td><div align="right">* Surname</div></td>
                                                      <td colspan="2"><span id="sprytextfield5">
                                                        <input name="surname" type="text" id="surname" tabindex="4" size="40" maxlength="30" />
                                                      <span class="textfieldRequiredMsg"> a value is required.</span></span></td>
                                                      <td> </td>
                                                    </tr>
                                                    <tr>
                                                      <td><div align="right">* Contact/ Bleep</div></td>
                                                      <td colspan="2"><span id="sprytextfield3">
                                                        <input name="contactno" type="text" id="contactno" tabindex="5" size="10" maxlength="6" />
                                                      <span class="textfieldRequiredMsg">a value is required.</span></span></td>
                                                      <td> </td>
                                                    </tr>
                                                    <tr>
                                                      <td><div align="right">Mobile (optional)</div></td>
                                                      <td colspan="2"><input name="mobile" type="text" id="mobile" tabindex="6" size="25" maxlength="18" />          <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></td>
                                                      <td> </td>
                                                    </tr>
                                                    <tr>
                                                      <td> </td>
                                                      <td colspan="2"> </td>
                                                      <td> </td>
                                                    </tr>
                                                    <tr>
                                                      <td><div align="right">* Job role</div></td>
                                                      <td colspan="2"><span id="spryselect2">
                                                        <select name="jobrole" id="jobrole" tabindex="7">
                                                          <option value="0">Select</option>
                                                          <option value="Doctor">Doctor</option>
                                                          <option value="CNS/NP">CNS/NP</option>
                                                          <option value="Midwife">Midwife</option>
                                                          <option value="Other Staff">Other Staff</option>
                                                          <option value="Nurse IP HCA">Nurse IP &amp; HCA</option>
                                                          <option value="Nurse OP HCA">Nurse OP &amp; HCA</option>
                                                          <option value="IP Physician Assitant">IP Physician Assistant</option>
                                                          <option value="OP Phlebotomist">OP Phlebotmist</option>
                                                          <option value="Pharmacists">Pharmacists</option>
                                                          <option value="Therapist AHP">Therapist &amp; AHP</option>
                                                          <option value="Medical Secretary">Medical Secretary</option>
                                                          <option value="Bed Manager">Bed Manager</option>
                                                          <option value="Medical Record Staff">Medical Records</option>
                                                          <option value="Medical Records Manager">Medical Records Mgr</option>
                                                          <option value="OP Booking Clerk">OP Booking Clerk</option>
                                                          <option value="OP Receptionist">OP Receptionist</option>
                                                          <option value="ED Admin">ED Admin</option>
                                                          <option value="Ward Administrator">Ward Administrator</option>
                                                          <option value="IP Wait List Clerk/Mgr">IP Wait List Clerk/Mgr</option>
                                                          <option value="Antenatal Supervisor">Antenatal Supervisor</option>
                                                          <option value="Clinical Coder">Clinical Coder</option>
                                                          <option value="Clinical Coding Mgr">Clinical Coding Mgr</option>
                                                          <option value="Pi Help Desk Backoffice">Pi Help Desk Analyst/Back Office</option>
                                                        </select>
                                                      <span class="selectInvalidMsg">Please select a valid item.</span></span></td>
                                                      <td> </td>
                                                    </tr>
                                                    <tr>
                                                      <td><div align="right">* Manager's Name</div></td>
                                                      <td colspan="2"><span id="sprytextfield4">
                                                      <input name="mgrname2" type="text" id="mgrname2" tabindex="8" size="40" maxlength="30" />
                                                      <span class="textfieldRequiredMsg"> a value is required.</span></span></td>
                                                      <td> </td>
                                                    </tr>
                                                    <tr>
                                                  
                                                      <td><div align="right"></div></td>
                                                      <td colspan="2"> </td>
                                                      <td> </td>
                                                    </tr>
                                                    <tr>
                                                      <td> </td>
                                                      <td colspan="2"> </td>
                                                      <td> </td>
                                                    </tr>
                                                    <tr>
                                                      <td><div align="right">* Course</div></td>
                                                      <td colspan="2"><span id="spryselect3">
                                                        <select name="courses" id="courses" form="form1" tabindex="10" title="course">
                                                          <option value="0">Select</option>
                                                          <option value="Doctors">Doctors</option>
                                                          <option value="Nurse IP">Nurse IP</option>
                                                          <option value="Nurse OP">Nurse OP</option>
                                                          <option value="Midwife">Midwife</option>
                                                          <option value="HCA">HCA</option>
                                                          <option value="Pharmacist">Pharmacist</option>
                                                          <option value="Back Office Staff">Back Office Staff</option>
                                                          <option value="AHP">AHP</option>
                                                          <option value="Pi Help Desk Analyst">Pi Help Desk Analyst</option>
                                                          <option value="Medical Secretary">Medical Secretary</option>
                                                          <option value="OP Phlebotmist">OP Phlebotmist</option>
                                                          <option value="Champion Users Doctors">Champion Users Doctors</option>
                                                          <option value="Champion Users Nurse IP">Champion Users Nurse IP</option>
                                                        </select>
                                                      <span class="selectRequiredMsg">Please select an item.</span></span></td>
                                                      <td> </td>
                                                    </tr>
                                                    <tr>
                                                      <td><div align="right">* Training Location </div></td>
                                                      <td><span id="spryselect4">
                                                        <select name="troom" required="required" id="troom" form="form1" tabindex="11" title="location">
                                                          <option value="0">Select</option>
                                                          <option value="CXH">Charing Cross</option>
                                                          <option value="HH">Hammersmith Hammersmith</option>
                                                          <option value="QEH">Queen Charlottee Hospital</option>
                                                          <option value="SMH">St Mary's Hospital</option>
                                                          <option value="WEH">Western Eye Hospital</option>
                                                          <option value="SCC">St Charles Community</option>
                                                        </select>
                                                      <span class="selectRequiredMsg">Please select an item.</span></span></td>
                                                     
                                                      <td> </td>
                                                      <td> </td>
                                                    </tr>
                                                    <tr>
                                                      <td><div align="right">* CPG</div></td>
                                                      <td><span id="spryselect5">
                                                        <select name="cpg2" required="required" id="cpg2" form="form1" tabindex="12" title="cpg">
                                                          <option value="0">Select</option>
                                                          <option value="CPG 1 Medicine">CPG1 - Medicine</option>
                                                          <option value="CPG 2 Surgery &amp; Cancer">CPG2 - Surgery and Cancer</option>
                                                          <option value="CPG3 Specialist Services">CPG3 - Specialist Services</option>
                                                          <option value="CPG4 Circulatory Services and Renal Medicine">CPG4 - Circulatory Services and Renal Medicine</option>
                                                          <option value="CPG5 Womens and Childrens">CPG5 - Womens and Childrens</option>
                                                          <option value="CPG6 Clinical and Investigative Sciences">CPG6 - Clinical and Investigative Sciences</option>
                                                          <option value="CP7 Private Patients">CPG7 - Private Patients</option>
                                                          <option value="Others">Others</option>
                                                        </select>
                                                      <span class="selectRequiredMsg">Please select an item.</span></span></td>
                                                      <td> </td>
                                                      <td> </td>
                                                    </tr>
                                                    <tr>
                                                      <td> </td>
                                                      <td><input type="submit" name="submitbt" id="submitbt" value="Submit" /></td>
                                                      <td> </td>
                                                      <td> </td>
                                                    </tr>
                                                    <tr>
                                                      <td> </td>
                                                      <td colspan="2"> </td>
                                                      <td> </td>
                                                    </tr>
                                                    <tr>
                                                      <td><div align="center">* Mandatory Fields</div></td>
                                                      <td colspan="2"> </td>
                                                      <td> </td>
                                                    </tr>
                                                    <tr>
                                                      <td> </td>
                                                      <td colspan="2"> </td>
                                                      <td> </td>
                                                    </tr>
                                                    <tr>
                                                      <td> </td>
                                                      <td colspan="2"> </td>
                                                      <td> </td>
                                                    </tr>
                                                  </table>
                                                  <input type="hidden" name="MM_insert" value="form1" />
                                                </form>
                                                <p> </p>
                                                <p> </p>
                                                <!-- end .content --></div>
                                              <div class="footer"></div>
                                            <script type="text/javascript">
                                            var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn:["blur", "change"]});
                                            var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {validateOn:["blur", "change"]});
                                            var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "none", {validateOn:["blur", "change"]});
                                            var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "none", {validateOn:["blur", "change"]});
                                            var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "integer", {validateOn:["blur", "change"]});
                                            var spryselect2 = new Spry.Widget.ValidationSelect("spryselect2", {invalidValue:"-1", isRequired:false, validateOn:["blur", "change"]});
                                            var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "none", {validateOn:["blur"]});
                                            var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "none", {validateOn:["blur", "change"]});
                                            var spryselect3 = new Spry.Widget.ValidationSelect("spryselect3");
                                            var spryselect4 = new Spry.Widget.ValidationSelect("spryselect4");
                                            var spryselect5 = new Spry.Widget.ValidationSelect("spryselect5", {validateOn:["blur", "change"]});
                                            </script>
                                            </body>
                                            </html>
                                            <?php
                                            mysql_free_result($rsattendance);
                                            ?>

                                            • 21. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
                                              MurraySummers ACP/MVPs

                                              Often a site will have a remote root folder like

                                               

                                              public_html

                                               

                                              Does yours?

                                              • 23. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
                                                MurraySummers ACP/MVPs

                                                You should NEVER have that folder in your local site.  Everything that is inside it will be improperly linked when you upload it.

                                                 

                                                Your local root folder appears to be properly pathed from your site definition image.  That folder should *not* contain a public_html folder.  It should probably contain a SpryAssets folder, a TSScript folder and a Connections folder, along with the rest of your local files.

                                                • 24. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
                                                  Reynold Dreamweaver CS6 Community Member

                                                  Sorry, thats an FTP screen of the server folders. My local folder is

                                                  dw local error.png

                                                  I have all the folders you mention in my local folder and I do not have the public_html. I place the contents of the local folder into the public_html once I upload it via dreamweaver.

                                                  • 25. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
                                                    MurraySummers ACP/MVPs

                                                    In your Remote site definition, public_html must be in the Root Directory field, just above the Web URL field.

                                                    • 26. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
                                                      Reynold Dreamweaver CS6 Community Member

                                                      Hi Murray,

                                                      I have added it to the server band panel.

                                                      DW Site def.png

                                                      I have also ticked the remote box, at the point is it just remote, I do not have a testing server. At least I know I done have. If it was it will be installed on my laptop. Maybe an Apache or a Windows IIS server. I have not installed either of the servers on my laptop.

                                                       

                                                      DW Site def 2.png

                                                      • 28. Re: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/phpzendr/pub
                                                        Reynold Dreamweaver CS6 Community Member

                                                        Thats wonderful, it works like a treat with my main static broadband. So this there is no cloud over site definition. Thank you.