ARRGG. PLEASE HELP

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
Pintonite
Forum Newbie
Posts: 17
Joined: Mon May 20, 2002 5:11 pm
Contact:

ARRGG. PLEASE HELP

Post by Pintonite »

I need some help here. I cannot figure out where the error is coming from? It says it has a parse error but everything is is good order. I must have checked this thing over atleast 15 times.

Code: Select all

<?

session_start();
$flag = 0;

if(isset($SESSION))&#123;

if((empty($class)) || (empty($professor)) || (empty($building)) || (empty($room)))&#123;
		print "<html><head><title>Information successfully added</title>
	      <meta http-equiv="refresh" content="2;URL=add_class.php?class=$class&professor=$professor&building=$building&room=$room"></head>
	      <body>Form not completed</body></html> "; 
&#125; else &#123;
	$connection = mysql_connect("localhost","fxmri","MarK");
	mysql_select_db("fxmri");

	$class_time = "$class_first_hour:$class_first_minute - $class_second_hour:$class_second_minute $class_ampm";
	$lab_time = "$lab_first_hour:$lab_first_minute - $lab_second_hour:$lab_second_minute $lab_ampm";

	$verify = mysql_query("SELECT uid, class, semester FROM class");

	while($row = mysql_fetch_array($verify)) &#123;	
		if(($SESSION&#1111;uid] != $row&#1111;"uid"]) && ($SESSION&#1111;class] != $row&#1111;"class"]) && ($SESSION&#1111;current_semester] != $row&#1111;"semester"])) &#123;
		mysql_query("INSERT INTO class VALUES ('$SESSIOIN&#1111;uid]','$class','$professor','$class_time','$notes','$building','$room','$days','$lab','$lab_time','$SESSION&#1111;current_semester]')");
		mysql_close($connection);
		print "<html><head><title>Information successfully added</title>
	      	<meta http-equiv="refresh" content="0;URL=login.php"></head>
	      	<body></body></html> ";
		$flag = 1;
		&#125; else 
		if($flag != 1) &#123;
			print "<html><head><title>Information successfully added</title>
	      	<meta http-equiv="refresh" content="0;URL=add_class.php"></head>
	      	<body></body></html> ";
		&#125;
&#125;
	
	&#125;
&#125; 
&#125; else &#123;

print "<html><head><title>You are not logged in yet</title>
      <meta http-equiv="refresh" content="2;URL=index.php"></head>
	<body> You are not logged in.</body></html>";
&#125;
?>
Thanks for the help and sorry for the dirty code
Last edited by Pintonite on Wed Jun 12, 2002 1:02 pm, edited 1 time in total.
Pintonite
Forum Newbie
Posts: 17
Joined: Mon May 20, 2002 5:11 pm
Contact:

Got it figured out

Post by Pintonite »

Nevermind.
Finally got it figured out. Apparently I need to put ' ' around my session variables that are strings.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

yes, that´'s better
the php-parser is forgiving but $_SESSION[class] is too much ;)

If it is still not working: content=\"0;URL=add_class.php" <- forgot \ before "
Pintonite
Forum Newbie
Posts: 17
Joined: Mon May 20, 2002 5:11 pm
Contact:

Post by Pintonite »

Thanks
Post Reply