Oh ok i didnt know that , below is the upload code . This code is used on the events page also .
[php]
if(isset($file)){ //check if the file has been selected for upload and do th following checks.
$image = addslashes(file_get_contents($_FILES['fileField'] ['tmp_name'])); // get the content of the image ready to be stored in an database.
$image_name = addslashes($_FILES['fileField']['name']); // get the name of the image.
$image_size = getimagesize($_FILES['fileField'] ['tmp_name']); // check the file is an image.
if($image_size == FALSE) { // this checks to see if the uplaoded file is an image or not.
$error .= " Please Only upload images"; // this displays if its not an image file.
}
}
// if there are no errors update the datebase
if(empty($error)){
// if there are no errors Insert the information into the database
$new_name = mysql_insert_id(); // get the id of the new row and rename the image
$upload = move_uploaded_file($_FILES['fileField']['tmp_name'], '/home/bookthat/public_html/users/event_images/'.$new_name.'.jpg');
// if the insert is succesful
if(!$sql){
$error .="Failed to enter the new event , please try again ";
}else{
// show a message to confirm the event has been added
$confirm .="Thank you, your event has been added.";
}
}
}// isset end
[/php]
Thanks Ian