Jump to content

[SOLVED] Unexpected $end?


George Botley

Recommended Posts

... Can anybody see any reason why this would output Unexpected $end on line 49?

 

<? 
$delete = $_GET["delete"];
$title = $_POST["title"];

if('yes' == $delete) {

/* Check if user has actually chosen a value */
if(empty($title)) {	
echo "<div class='alerterror_info'>
<strong>Please Choose A Category...</strong> - $fname, Please choose a category you would like to delete...</div>";	
{

/* If returned true remove photos and category */

$con = mysql_connect("$server","$dbuser","$dbpass");
$database = mysql_select_db("$database", $con);

	/* Delete Photos from Server */
	$query_find = "SELECT * FROM ap_gallery WHERE category = '$title'";
	mysql_query($query_find);

		while($row = mysql_fetch_array($runquery_find)) {
			$photourl = $row["photourl"];

			unlink("./userfiles/image/$photourl");

		}


	/* Delete Category and Photos from Database */
	$query = "DELETE FROM ap_gallery_cat WHERE title = '$title'";
	mysql_query($query); 	

	$querytwo = "DELETE FROM ap_gallery WHERE category = '$title'";
	mysql_query($runquery);

	/* Forward to Completion Message */
	echo "<meta http-equiv='refresh' content='0;url=index.php?ToDo=WebsiteContent/Gallery&error=no3' />";




}


?>

 

The objective of the script is the delete a gallery category and images form a database as well as removing the images themselves from the server.

 

Link to comment
https://forums.phpfreaks.com/topic/148061-solved-unexpected-end/
Share on other sites

This

 

   /* Check if user has actually chosen a value */
   if(empty($title)) {   
   echo "<div class='alerterror_info'>
   <strong>Please Choose A Category...</strong> - $fname, Please choose a category you would like to delete...</div>";   
   {

 

should be this...

 

   /* Check if user has actually chosen a value */
   if(empty($title)) {   
   echo "<div class='alerterror_info'>
   <strong>Please Choose A Category...</strong> - $fname, Please choose a category you would like to delete...</div>";   
   } // <--- this was wrong way round

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.