This isn't working.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Wldrumstcs
Forum Commoner
Posts: 98
Joined: Wed Nov 26, 2003 8:41 pm

This isn't working.

Post 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?
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post 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.
User avatar
PrObLeM
Forum Contributor
Posts: 418
Joined: Sun Mar 07, 2004 2:30 pm
Location: Mesa, AZ
Contact:

Post 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";
Post Reply