Jump to content

Parse error:syntax error,unexpected $event_date' (T_VARIABLE)


xanie

Recommended Posts

There are no "Syntax" errors with the code that you pasted. Most likely the error is somewhere else in the file. Please copy/paste all relevant code, and we can review and see if there are any obvious errors in the code.

here is the full code.. tnx

 

<?php 
	 if(isset($_POST['submit']))
	 {
	  $event_name  = $_POST['event_name'];
	  $event_details = $_POST['details'];
	  $event_date  = $_POST['date_from'];

	  $event_image = $_POST['event_image'];


	  if(!empty($_FILES['event_image']['name']))
	  {
	   $fileName = $_FILES['event_image']['name'];
	   $tmpName  = $_FILES['event_image']['tmp_name'];
	   $fileSize = $_FILES['event_image']['size'];
	   $fileType = $_FILES['event_image']['type'];


	   $fp      = fopen($tmpName, 'r');
	   $content = fread($fp, filesize($tmpName));
	   $content = addslashes($content);
	   fclose($fp);
	   if(!get_magic_quotes_gpc())
	   {
	    $fileName = addslashes($fileName);
	   }
	  }
	  else
	  {
	   $content  = "NULL";
	   $fileName = "NULL";
	   $fileType = "NULL";
	  }
	 cdv

	 $event_date  =  date('M d, Y', strtotime($event_date)); // outputs 2006-01-24  




	  mysql_query("INSERT INTO events (event_name, event_details, event_date, photo, photo_name, photo_file_type)
		     VALUES('$event_name', '$event_details', '$event_date', '$content', '$fileName', '$fileType')  ") or die(mysql_error());


	  echo "<span class='approved_msg'>Your New Event Has Been Posted.</span>";
	    header("refresh: 2; url=../index.php"); 
	 }
	 ?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.