Click to See Complete Forum and Search --> : parse error


lukezweb
01-07-2004, 12:50 PM
i get this error wiht this...

Parse error: parse error in /home/shoutbox/public_html/simpleforum/reply.php on line 143


<html>
<head>
<style type="text/css">
<!--
// SimpleForums Style Sheet
A:link { text-decoration: none; color: 005177; }
A:visited { text-decoration: none; color: 005177; }
A:hover { text-decoration: strikethrough; color: 005177; }
BODY {
background-color: F8F8F8;
font-family: Arial;
font-size:14px;
margin-top: 0;
margin-left: 0;
margin-right: 0;
padding-top: 0;
padding-left: 0;
padding-right: 0;
}
TD { font-family: Arial; color: 000000; font-size:14px; }

input {
font-family: Arial;
font-size: 14px;
color: 000000;
background-color: #DEE7EF;
border-color: 005177;
}
textarea {
font-family: Arial;
font-size: 14px;
color: 000000;
background-color: #DEE7EF;
border-color: 005177;
}
select {
font-family: Arial;
font-size: 14px;
color: 000000;
background-color: #DEE7EF;
border-color: 005177;
}
.windowbg {
background-color: EEEEEE;
font-size: 14px;
font-family: Arial;
color: 000000;
}
.windowbg2 {
background-color: F8F8F8;
font-size: 14px;
font-family: Arial;
color: 000000;
}
.hr {
color: 000000;
}
.titlebg {
font-size: 14px;
background-color: DEE7EF;
font-family: Arial;
color: 000000;
}
.catbg {
color: 005177;
background-color: DEE7EF;
font-family: Arial;
font-size: 14px;
}
.menubg {
color: 005177;
background-color: DEE7EF;
font-family: Arial;
font-size: 14px;
}
-->
</style>
<title>Simple Forums</title>
<script>
function add(tags){
document.getElementsByTagName('textarea')[0].innerHTML+=tags;
}
</script>
</head>
<body text=005177 link=005177 vlink=005177 alink=005177 background=http://www.geocities.com/road_runner351/windowbg2.txt>
<br>
<table width=92% cellspacing=1 border=0 align=center bgcolor=005177 cellpadding=4>
<tr>
<td class=windowbg valign=middle align=center>
<font size=5>Simple Forums</font>
</td>
</tr>
<tr>
<td align=center class=menubg>
<a href=index.php>Home</A> -
<a href=index.php?action=admin>Admin</a>
</td>
</tr>
</table>
<br/>
<table width=92% align=center>
<tr>
<td width=50% align=left>
Welcome, Guest!
</td>
<td width=50% align=right>
<?php
print date("G:i:sa , j/m/Y");
?>
</td>
</tr>
</table>
<center>
<?php $id = (isset($_GET['display'])) ? $_GET['display'] : "";?>
<?php
if ($_POST['submit']) {
$postedby = $_POST['postedby'];
$message = $_POST['message'];
$user = "shoutbox_admin";
$host = "localhost";
$password = "admin";
$database = "shoutbox_simple";
$connection = mysql_connect($host,$user,$password)
or die ("Could not connect");
$db = mysql_select_db($database,$connection)
or die ("Could not select");
$sql = " INSERT INTO `$id` ( `threadname` , `postedby` , `message` , `ip` ) VALUES ( '', '$postedby', '$message', '' );";
mysql_query($sql);
} else {
?>
<table width=92% cellspacing=1 border=0 align=center bgcolor=005177 cellpadding=4>
<tr>
<td class=catbg>
Simple Forums :: Reply Posted...</td>
</tr>
<tr>
<td width=100% valign=top align=center class=windowbg>
You post has been posted click here to go back to the thread....
</td>
</tr>
</table>
<?php
} else {
?>
<table width=92% cellspacing=1 border=0 align=center bgcolor=005177 cellpadding=4>
<tr>
<td class=catbg>
Simple Forums :: Posting a Reply...</td>
</tr>
<tr>
<td width=100% valign=top align=center class=windowbg>
<?php
echo "<form name=postreply method=post action=".$_SERVER['PHP_SELF'].">";
?>
Name: &nbsp;<input type=text name=postedby>
<input type=hidden name=rank value=Member>
</td>
</tr>
<tr>
<td width=100% valign=top align=center class=windowbg>
[<a href=javascript:add("")>BOLD</a>]
[<a href=javascript:add("")>ITALIC</a>]
[<a href=javascript:add("")>UNDERLINED</a>]
</td>
</tr>
<tr>
<td width=100% valign=top align=center class=windowbg>
<textarea cols=50 rows=10 name=message></text>
</td>
</tr>
<tr>
<td width=100% valign=top align=center class=catbg>
<input type=submit name=submit value=Post></form>
</td>
</tr>
</table>
<?php } ?>
</center>
<br/>
<center>
<font face=Verdana>Get Your Own Simple Forum Today!</FONT></CENTER>
</body>
</html>



i believe its in this:


<?php
if ($_POST['submit']) {
$postedby = $_POST['postedby'];
$message = $_POST['message'];
$user = "shoutbox_admin";
$host = "localhost";
$password = "admin";
$database = "shoutbox_simple";
$connection = mysql_connect($host,$user,$password)
or die ("Could not connect");
$db = mysql_select_db($database,$connection)
or die ("Could not select");
$sql = " INSERT INTO `$id` ( `threadname` , `postedby` , `message` , `ip` ) VALUES ( '', '$postedby', '$message', '' );";
mysql_query($sql);
} else {
?>

pyro
01-07-2004, 01:07 PM
Which line is 143, please?

lukezweb
01-07-2004, 01:10 PM
Originally posted by pyro
Which line is 143, please?


as i said above i believe its here:



<?php
if ($_POST['submit']) {
$postedby = $_POST['postedby'];
$message = $_POST['message'];
$user = "shoutbox_admin";
$host = "localhost";
$password = "admin";
$database = "shoutbox_simple";
$connection = mysql_connect($host,$user,$password)
or die ("Could not connect");
$db = mysql_select_db($database,$connection)
or die ("Could not select");
$sql = " INSERT INTO `$id` ( `threadname` , `postedby` , `message` , `ip` ) VALUES ( '', '$postedby', '$message', '' );";
mysql_query($sql);
} else {
?>



i think it might be the vars you see i was edditing that then the errors came ;)

pyro
01-07-2004, 01:12 PM
That looks like 16 lines to me. Which line is 143, please?

lukezweb
01-07-2004, 01:13 PM
Originally posted by pyro
That looks like 16 lines to me. Which line is 143, please?



$postedby = $_POST['postedby'];
$message = $_POST['message'];

pyro
01-07-2004, 01:17 PM
You have and else { at the end that is not closed. Do you close that later on?

Also, if ($_POST['submit']) { should be if (isset($_POST['submit'])) {. The first way may work on your server, but it is not the correct way, and will cause errors on many servers.

lukezweb
01-07-2004, 01:24 PM
Originally posted by pyro
You have and else { at the end that is not closed. Do you close that later on?

Also, if ($_POST['submit']) { should be if (isset($_POST['submit'])) {. The first way may work on your server, but it is not the correct way, and will cause errors on many servers.


i think ive found the problem :)

lukezweb
01-07-2004, 01:28 PM
Originally posted by lukezweb
i think ive found the problem :)


ok i got rid of the error but my sql doesnt send


this page...

http://www.shoutbox.forgedhosting.com/simpleforum/thread.php?display=11

should send data to the sql server into the table id = 11 as the var id gets the display i cnat see why it doesnt work ?

pyro
01-07-2004, 01:39 PM
I fail to see where you have definied $id.

lukezweb
01-07-2004, 01:45 PM
Originally posted by pyro
I fail to see where you have definied $id.


<?php $id = (isset($_GET['display'])) ? $_GET['display'] : "";?>

pyro
01-07-2004, 02:22 PM
The get variable 'display' is no longer set once users get the reply.php 'post' is, however...

lukezweb
01-07-2004, 03:10 PM
Originally posted by pyro
The get variable 'display' is no longer set once users get the reply.php 'post' is, however...


however?...

pyro
01-07-2004, 03:13 PM
Originally posted by pyro
'post' is, however... You have a GET variable named 'post'. It looks like that is what you meant.