I think I changed the right bit
PHP Code:<?php
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("keyboard_test") or die(mysql_error());
if(isset($_COOKIE['ID_my_site']))
{
$username = $_COOKIE['ID_my_site'];
$pass = $_COOKIE['Key_my_site'];
$check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error());
while($info = mysql_fetch_array( $check ))
{
if ($pass != $info['password'])
{ header("Location: login.php");
}
else
{
}
}
}
else
{
header("Location: login.php");
}
$links = "link2.php";
?>
<?php
if (isset ($_POST['submit']))
{
$comment = mysql_escape_string ( '<b>' . trim (nl2br($_POST['comment'])) . '</b>' );
$quantity = $_POST['quantity'];
$item = $_POST['item'];
$cheese = "<b>$username</b><br /> $comment ";
$sql = mysql_query ("INSERT INTO comments (id,comments,date,ip) VALUES ('0','".$cheese."','".$date."','" . $_SERVER['REMOTE_ADDR']"')");
echo 'Your comment has been entered successfully!';
echo '<a href="echo time.php">Please click here</a>';
}
else
{
?>
<html>
<head>
<body style="background-color:lightgreen">
</head>
<body>
<?php include("$links");
echo "Hey ".$username;
?>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<p><b>COMMENTS</b></p>
<?php
// POST data wasnt entered, so display the comments and comment form
// view comments from database
$sql = mysql_query ("SELECT * FROM comments") or die(mysql_error());;
while ($row = mysql_fetch_array ($sql)) {
echo $row['comments'].'<br />';
}
echo '<br /><br />
<form action="echo time.php" method="post">
Comments:<br />
<textarea name="comment" cols="40" rows="7"></textarea>
<input type="submit" value="Submit" name="submit">
</form>';
}
?>
</body>
</html>
but it's still coming up with the same error
( ! ) Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\Documents and Settings\Owner\Desktop\canberra amatuer productions\www\Canberra Amatuer Productions\echo time.php on line 58



Reply With Quote


Bookmarks