Jump to content

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


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"); 
	 }
	 ?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.