Page 1 of 1

This isn't working.

Posted: Thu Jan 20, 2005 7:44 pm
by Wldrumstcs
Okay, I am getting an error on the line "$main .= </select>" saying "Parse error: parse error, unexpected T_VARIABLE in public_html/wwshs/delete.php on line 109"

Code: Select all

mysql_connect("localhost","$username","$password") or die ("Unable to connect to MySQL server."); 
$db = mysql_select_db("$database") or die ("Unable to select requested database.");

$query="SELECT * FROM teachers ORDER BY id ASC";
$result=mysql_query($query);


$main = "<form method='POST' action='delete.php?a=verify'>
            <table border='0' width='100%' cellspacing='0' cellpadding='0' id='table10'>
          
                <tr>
                    <td align='center' width='100%' colspan='2'>
                    <b><font size='2'>*NOTE*:&nbsp; Don't abuse this power...</font></b></td>
                </tr>
<tr>
<td height='10'>
</td>
</tr>
                <tr>
                    <td align='right' width='50%' valign='top'>
                    <p align='right'><b>Your Name:</b></td>
                    <td align='left' width='50%'>$_COOKIE&#1111;username]<br>
                    <font size='2'>(To login under a different username, </font> 
<a href='http://www.****.com/login.php?a=logout'>
<font size='2'>click here.)</font></a></td>
                </tr>
                <tr>
                    <td align='right' width='50%'><b>Teacher that will be deleted:</b></td>
                    <td width='50%' align='left'>
                      <select name='filter_teachers'>
  <option value='showall'>Choose a Teacher</option>
      <option>----------------------</option>";

while ($teacher = mysql_fetch_array($result)) &#123;
$main .= "<option value='$teacher&#1111;username]'>$teacher&#1111;username]</option>\n";
&#125;
    
$main .=  "</select>
  </td>
                    </tr>
                    <tr>
                    <td align='right' width='50%'>&nbsp;</td>
                    <td align='left' width='50%'>&nbsp;</td>
                </tr>
            </table>
            <p>
            <input type='submit' value='Proceed' name='submit' tabindex='3' style='font-weight: bold; border-style: dashed; border-width: 1px; background-color: #999999'></p>
                        
        </form>";
Where's the error?

Posted: Thu Jan 20, 2005 8:15 pm
by rehfeld
i dont see any errors in the coe you posted.

theres obviously some more code if the error was on line 109, cause you didnt post 109 lines of code.

look at the code that comes before it. sounds like you forgot a ; somewhere

if your php editor uses syntax highligting it should be easy to spot.

Posted: Fri Jan 21, 2005 1:33 pm
by PrObLeM
try changing

Code: Select all

$main .= "<option value='$teacher&#1111;username]'>$teacher&#1111;username]</option>\n";
to

Code: Select all

$main .= "<option value='".$teacher&#1111;username]."'>".$teacher&#1111;username]."</option>\n";