George Botley Posted March 5, 2009 Share Posted March 5, 2009 ... 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 More sharing options...
ILMV Posted March 5, 2009 Share Posted March 5, 2009 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 Link to comment https://forums.phpfreaks.com/topic/148061-solved-unexpected-end/#findComment-777137 Share on other sites More sharing options...
George Botley Posted March 5, 2009 Author Share Posted March 5, 2009 Oh... Thanks for that solution. I will see if it works... Link to comment https://forums.phpfreaks.com/topic/148061-solved-unexpected-end/#findComment-777144 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.