PHP Problem

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
Drezard2
Forum Newbie
Posts: 4
Joined: Sun Sep 17, 2006 1:35 am

PHP Problem

Post by Drezard2 »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Here is the error:
[quote]
Parse error: syntax error, unexpected '<' in C:\Program Files\xampp\htdocs\modcp.php on line 57
[/quote]

But line 57 is HTML not even PHP.

Heres the script:

Code: Select all

<!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=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
$query = "SELECT * FROM users;";
$result = mysql_query($query) or die ('ERR nr1');
?>
<table border="1">
<?php
while ($row = mysql_fetch_array($result))
{
    ?>
    <tr>
   
    <td>
    <?php echo $row['user']; ?>
    </td>
   
    <td>
    <?php echo $row['pass']; ?>
    </td>
   
    <td>
    <?php echo $row['name']; ?>
    </td>

    <td>
    <?php echo $row['email']; ?>
    </td>
	
    <td>
    <?php echo $row['daytime']; ?>
    </td>
	
	<td>
    <?php echo $row['nighttime']; ?>
    </td>
   
   <td>
   <?php echo $row['mobile']; ?>
   </td>
   
    <td>
    <a href="www.site.com/change.php?var=<?php echo $row['user_id']; ?>">EDIT LINK</a>
    </td>
   
    </tr>
    <?php
}
?>
</table>
<?php
</body>
</html>
- Cheers, Daniel


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
zyklon
Forum Commoner
Posts: 49
Joined: Mon Jul 31, 2006 7:14 pm
Location: MA, USA

Post by zyklon »

look at the never ending <?php line the 3rd line from the bottom, kind of explains your problem.
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Re: PHP Problem

Post by aaronhall »

Code: Select all

<?php
</body>
</html>
Just take out that opening tag -- PHP is trying to parse your closing body and html tags
Post Reply