problem of scripts on this page

Links for php scripts

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 83
Joined: Thu Jun 03, 2004 11:27 am

Fri Apr 15, 2005 4:05 pm

Parse error: parse error in c:\program files\easyphp1-8\www\charlton\connect_2.php on line 88

Don't know why this happened, even I tried to fix what was implying of the error message, it is still wrong. Here is the codes:
//if the index entered is set (not null)
if (isset($_SESSION['entered'])){
//print it
echo $_SESSION['entered'];
//if index'submit' is set and true and if index 'enter' is not set then
if( (isset($_POST['submit']) &&($_POST['submit'])) && !isset($_SESSION['entered']) ){
echo 'Form submitted';
//else if index ''submit is set and true and index 'entered' is set and is true, then
elseif(( (isset($_POST['submit'])) && ($_POST['submit']))&&( (isset($_SESSION['entered'])) && ($_SESSION['entered']=="true"))){
echo 'You already submitted the form.';
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<style type="text/css">
.result {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
padding-top: 5px;
border: 1px solid #660000;
padding-bottom: 5px;
padding-left: 10px;
.record {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
color: #333333;
padding-left: 0px;
border-bottom: 1px solid #ccc;
.formtab {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
color: #FF9900;
background-color: #660000;
.dele {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
color: #660000;
padding-left: 10px;
border-bottom: 1px solid #ccc;
text-decoration: underline;


<?php if (isset($_GET['addlove']))://user wants to add a loving text?>
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
<label class="formtab">Type your loving words here:<br>
<textarea name="lovetext" rows="10" cols="40"></textarea><br>
Name:<input type="text" name="authorname"><br>
Email:<input type="text" name="authoremail"><br>
<input type="submit" value="SUBMIT">
<?php else:// Default page display
//Connect to the database server
$db =@mysql_connect('localhost','root','');
exit('<p>Unable to connect to the'.'database server at this time.</p>');
//Select the godblessing database
exit('<p>Unable to locate the love'.'database at this time.</p>');
//if a loving text has been submitted,
//add it to the database.
if(isset($_POST['lovetext']) && isset($_POST['authorname']) && isset($_POST['authoremail'])) {
$sql="INSERT INTO love SET
if (@mysql_query($sql)){
echo'<p class="record"> Your loving text has been added.</p>';
echo '<p class="record">Error adding submitted love:'.mysql_error().'</p>';
//if a love has been deleted
//remove it from the database
if(isset( $_GET[ 'deletelovetext'])){
$sql="DELETE FROM love WHERE id=$id";
echo'<p class="record">The loving word has been deleted.</p>';
echo'<p class="record">Error deleting lovetext:'.'mysql_error()'.'</p>';

<p class="result">Here are all the love in our database:</p>
//request the text of all the loves
$result=@mysql_query('SELECT id, lovetext,authorname,authoremail FROM love');
exit('<p>Error performing query:'.mysql_error().'</p>');
//Display the text of each love in a paragraph
echo '<p class="record">'.$lovetext.'<a href="'.$_SERVER['PHP_SELF'].'?deletelovetext='.$id.'"><span class="dele">delete</span></a></p>';
echo '<p class="record">'.$authorname.'<a href="'.$_SERVER['PHP_SELF'].'?deletelovetext='.$id.'"><span class="dele">delete</span></a></p>';
echo '<p class="record">'.$authoremail.'<a href="'.$_SERVER['PHP_SELF'].'?deletelovetext='.$id.'"><span class="dele">delete</span></a></p>';

//when clicked, this link will load this page
//with the love submission form displayed
echo'<p class="record"><a href="'.$_SERVER['PHP_SELF'].'?addlove=1">Add your loving text!</a></p>';

Post Reply