PDA

View Full Version : Question on this error?


2bz2p
07-10-2008, 03:13 AM
Hi,

So I have come across this before but cant remember what it is and or its fixes.


Parse error: syntax error, unexpected $end in C:\wamp\www\vpilot\VPilot_Dev\manage_fleet_add.php on line 292

Thanks
2b

Solved it was a missing }, but what does the error mean, that there is a missing curly bracket???
thanks agian

edbr
07-10-2008, 05:20 AM
If you have solved it then yup that was the unexpected $end i would think

davidj
07-10-2008, 05:45 AM
post ya code

2bz2p
07-11-2008, 04:47 AM
Yeah I was just wondering the what possibilities to look for when I get it.
Thanks
2b

I marked out the curly bracket that was missing.

if(isset($_POST['add'])) {
$name = addslashes (trim($_POST['name']));
$serv_date = addslashes (trim($_POST['serv_date']));
$description = addslashes (trim($_POST['description']));
$target_path = $cfg['dir'] . 'source/images/fleet/' . $_FILES['uploadedfile']['name'];
move_uploaded_file($_FILES['uploadedfile']['tmp_name'],$target_path);
$image = $_FILES['uploadedfile']['name'];
/*echo $name. "<br />";
echo $number. "<br />";
echo $description. "<br />";
echo $image. "<br />";
echo "<pre>";
print_r($_FILES);
echo "</pre>";*/
mysql_select_db($database_conn_abrv, $conn_abrv);
mysql_query("INSERT INTO fleet (name, serv_date, description, image) VALUES ('$name', '$serv_date', '$description', '$image')") or die (mysql_error( 'Not inserted'));

header( 'Location:'.$cfg['domain'].'index.php?action=fleet&change=added');
exit;

} //it was this brace missing.