Last Line Parse Error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
$var
Forum Contributor
Posts: 317
Joined: Thu Aug 18, 2005 8:30 pm
Location: Toronto

Last Line Parse Error

Post 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?
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Re: Last Line Parse Error

Post 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.
User avatar
$var
Forum Contributor
Posts: 317
Joined: Thu Aug 18, 2005 8:30 pm
Location: Toronto

Post by $var »

thanks charles! that's a great tip.
Post Reply