I keep getting an error that saysParse error: syntax error, unexpected T_ENDIF in nbc_uploader.php on line 46
I have looked at this code repeatedly and I can't find where I'm missing something.
I have looked at this code repeatedly and I can't find where I'm missing something.
Code:
<?php /******************************************************** ***This file is for uploading games ***Author: Stuart Altschuler ***Created: September 5, 2011 ********************************************************/ include "inc_dbcnx.php"; /*include "inc_header.php";*/ if ($_FILES['uploadedfile'] !="") { $fileName = $_FILES['uploadedfile']['name']; if((strlen($fileName) == 11) || (strlen($fileName) == 12)) { $year = substr($fileName,0,2); $month = substr($fileName,2,2); $day = substr($fileName,4,2); $start_date = "20"; $start_date .= $year; $start_date .="-"; $start_date .= $month; $start_date .="-"; $start_date .= $day; $end_date = $start_date; $title = $_POST['game_type']; } /* if ($_POST['game_time'] = "9:00 am") { $game_time = "09:00:00";} else { if ($_POST['game_time'] = "1:00 pm") { $game_time = "13:00:00";} else {$game_time = "19:00:00";} endif;} endif; */ $session = (strtoupper(substr($filename,7,1))); if ($session = "M") { $game_time = "09:00:00";} else { if ($session = "A") { $game_time = "13:00:00";} else {$game_time = "19:00:00";} } $recur="s"; $repeat=0; $author=1; $category=1; /*Create the Link*/ $link="http://naplesbridgeplay.com/wp-content/results/"; $link .= ( $_FILES['uploadedfile']['name']); /*Upload the file*/ $target_path = "wp-content/results/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } /*Create the MYSQL Insert*/ $caltable = "wp_calendar"; $sql = "insert into " ; $sql .= $caltable ; $sql .= " (event_begin, event_end, event_title, event_time, event_recur,event_repeats, event_author, event_category, event_link) VALUES ($start_date, $end_date, $title, $game_time,$recur, $repeat, $author, $category, $link)"; $sql_result = mysql_query($sql); else { header("LOCATION: upload.php"); exit;} } ?> <html> <head> <title>Results Upload Success</title> </head> <body> <h3> Goody!</h3> </body> </html>
Comment