LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-07-2006, 02:42 PM   #1
toxiccloud
LQ Newbie
 
Registered: Nov 2006
Posts: 1

Rep: Reputation: 0
parse error


Parse error: parse error, unexpected $end in C:\wamp\www\CloudLog2\common.php on line 21


Code:
<?php // common.php

function error($msg) {    
	?>
	<html>
	<head>    
	<script language="JavaScript">    
	<!--        
		alert("<?=$msg?>");        
		history.back();    
	//-->    
	</script>    
	</head>    
	<body>    
	</body>    
	</html>    
	<?    
	exit;
}

?>
 
Old 11-08-2006, 07:04 AM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
What exactly are you trying to do. It looks like there are a few syntax errors in your code. I would probably do something like,
Code:
<?php // common.php

function error($msg) {

    print<<<ERRORMSG
	<html>
	<head>    
	<script language="JavaScript">    
	<!--        
		alert('$msg');        
		history.back();    
	//-->    
	</script>    
	</head>    
	<body>    
	</body>    
	</html>    
ERRORMSG;

	exit;
}

?>

Last edited by reddazz; 11-08-2006 at 07:18 AM. Reason: fix code
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What's the meaning of "PHP Parse error: parse error, unexpected $ in..." frandalla Programming 23 03-04-2009 12:34 PM
Parse Error, but why? Mistro116@yahoo.com Programming 2 11-13-2005 02:38 PM
in gcc compiler error: parse error before string constsnt cynthia_thomas Linux - Networking 1 10-20-2005 01:29 AM
Parse Error verbatim Programming 3 04-22-2005 09:16 AM
Parse Error in G++ ashwinipahuja Programming 1 04-29-2004 01:47 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration