ok i have a php file that uploads image. it consists of <input name="uploadedfile" type="file"> and a "continue" button. so when the user click continue, it validates and check for valid image file. If is successful, then it does not immediately save the image into the server but it goes to order.php whereby user key in their particulars. Therefore, i acutally though of saving the upload image path into sessions. So once the order.php is through, i will save the user particulars into mysql and upload the image into the server. this is what i do:
uploader.php
<?php
session_start();
$target_path = "Upload/$id.JPEG";
$_SESSION['imgPath']=$target_path;
if(!ereg("image",$_FILES['uploadedfile']['type']))
{
header("location:error.php");
}
else
header("Location: order.php");
?>
However, when i tried to upload the image in order.php it wont work. This is my coding:
order.php
<?php
session_start();
$custQuery = "INSERT .............";
mysql_query($custQuery);
move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $_SESSION['imgPath']);