Jump to content

unexpected ';'


adamriley

Recommended Posts

Hi any one tell me how to make the page work please "im new to php"

 

Error log

-----------------------------

[sun Feb 07 16:39:24 2010] [error] [client 127.0.0.1] PHP Parse error:  syntax error, unexpected ';' in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\Brinnington\\Contact\\Display.php on line 9

-------------------------------

Display.php

<?php
$pfile = fopen("Comments.txt","r");
rewind($pfile);
while (!feof($pfile)) {
$line = fgets($pfile);
$tmp = explode(':', $line);
$tmp[0] == $Name {
$tmp[1] == $Comment {
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Untitled Page</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="bv_Text1" style="position:absolute;left:28px;top:22px;width:675px;height:36px;z-index:0;" align="center">
<font style="font-size:32px" color="#000000" face="Arial">Veiw Comments</font></div>
<input type="text" id="Editbox1" style="position:absolute;left:238px;top:103px;width:467px;font-family:Courier New;font-size:16px;z-index:1" name="Editbox1" value="<?php echo $name ?>">
<div id="bv_Text2" style="position:absolute;left:27px;top:106px;width:150px;height:27px;z-index:2;" align="left">
<font style="font-size:24px" color="#000000" face="Arial">There Name</font></div>
<div id="bv_Text3" style="position:absolute;left:24px;top:158px;width:174px;height:27px;z-index:3;" align="left">
<font style="font-size:24px" color="#000000" face="Arial">There comment</font></div>
<textarea name="TextArea1" id="TextArea1" style="position:absolute;left:245px;top:153px;width:449px;height:150px;font-family:Courier New;font-size:16px;z-index:4" rows="7" cols="41"><?php echo $comment ?></textarea>
</body>
</html>

 

Link to comment
https://forums.phpfreaks.com/topic/191256-unexpected/
Share on other sites

<?php
$pfile = fopen("Comments.txt","r");
rewind($pfile);
while (!feof($pfile)) {
$line = fgets($pfile);
list($name,$comment) = explode(':', $line);
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Untitled Page</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="bv_Text1" style="position:absolute;left:28px;top:22px;width:675px;height:36px;z-index:0;" align="center">
<font style="font-size:32px" color="#000000" face="Arial">Veiw Comments</font></div>
<input type="text" id="Editbox1" style="position:absolute;left:238px;top:103px;width:467px;font-family:Courier New;font-size:16px;z-index:1" name="Editbox1" value="<?php echo $name; ?>">
<div id="bv_Text2" style="position:absolute;left:27px;top:106px;width:150px;height:27px;z-index:2;" align="left">
<font style="font-size:24px" color="#000000" face="Arial">There Name</font></div>
<div id="bv_Text3" style="position:absolute;left:24px;top:158px;width:174px;height:27px;z-index:3;" align="left">
<font style="font-size:24px" color="#000000" face="Arial">There comment</font></div>
<textarea name="TextArea1" id="TextArea1" style="position:absolute;left:245px;top:153px;width:449px;height:150px;font-family:Courier New;font-size:16px;z-index:4" rows="7" cols="41"><?php echo $comment; ?></textarea>
</body>
</html>

 

Should do the trick..

Link to comment
https://forums.phpfreaks.com/topic/191256-unexpected/#findComment-1008410
Share on other sites

Hi it works is there away to after it has finished putting the name and the comment in the file to go to the next line because the next comment that comes along is on the same line and also is there away to stop a box from apearing at the start and finish of the coment

Link to comment
https://forums.phpfreaks.com/topic/191256-unexpected/#findComment-1008424
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.