Page 1 of 1

Last Line Parse Error

Posted: Mon Nov 07, 2005 3:54 pm
by $var
What does it mean when the parse error is on the last line of the document, like, in this case </html>?
I get it sometimes, but I have never really figured out how I make it go away.

the only code that i haven't commented out in test is this:

Code: Select all

<?
	switch ($_POST['submit']) {
	   	case 'preview' :
	    echo 'This is a preview of "$_POST[text]"';
	   	break;

	   	case 'insert' : 
		{
		$sql = "INSERT INTO phpbbeditor_content (
		phpbbeditor_Text,
		phpbbeditor_URL,
		phpbbeditor_Date,
		phpbbeditor_Image) 
		VALUES (
		'".$_POST["text"]."',
		'".$_POST["url"]."',
		'".$_POST["date"]."',				
		'".$_POST["image"]."')";
		$result = mysql_query($sql) or die (mysql_error());
		?>
I'm not certain how to do previews,this is my first attempt, perhaps this looks off?

Re: Last Line Parse Error

Posted: Mon Nov 07, 2005 5:09 pm
by Charles256
$var wrote: case 'insert' :
{
$sql = "INSERT INTO phpbbeditor_content (
phpbbeditor_Text,
phpbbeditor_URL,
phpbbeditor_Date,
phpbbeditor_Image)
VALUES (
'".$_POST["text"]."',
'".$_POST["url"]."',
'".$_POST["date"]."',
'".$_POST["image"]."')";
$result = mysql_query($sql) or die (mysql_error());
?>

I'm not certain how to do previews,this is my first attempt, perhaps this looks off?
see where i bolded andunderlined and italicized and bolded again? you opened up a bracket and didn't close it..not too sure why you opened up the bracket in the first place..but generally if you get an error on the las tline that meets you opened something and didn't close it.

Posted: Tue Nov 15, 2005 12:03 pm
by $var
thanks charles! that's a great tip.