Hey guys.


I'm currently coding a registering form for my brother and i'm having some issue with the uploading section.

I have a form (With name/email etc) and a Upload Video - Click here < This opens a new window where people can browse for a video and select it for upload -

The uploading part works - it checks for things i want it to check for, which is perfect but i need it to do 2 things after it has succesfully uploaded.

1. Save the path of the video uploaded in a Session or something els that i havnt thought about which you can help me with.

2. Close the upload window and make the "click here" link unclickable.



The 2nd part should be easy enough if it can check if a certain Session is set - if so that person wont be able to upload a video until he fills out the entire form and then clicks "Create" which is when it will upload the path (from nr. 1 Session) to Database along with all the other information - once thats don't it should remove all Session.


Here is my code for upload.php which is defined in
PHP Code:
<form enctype="multipart/form-data" action="upload.php" method="POST"
:

PHP Code:
$target "upload/"
 
$target $target basename$_FILES['uploaded']['name']) ; 
 
$ok=1
 
 
//This is our size condition 
 
if ($uploaded_size 350000
 { 
 echo 
"Your file is too large.<br>"
 
$ok=0
 } 
 
 
//This is our limit file type condition 
 
if ($uploaded_type =="text/php"
 { 
 echo 
"No PHP files<br>"
 
$ok=0
 } 
 
 
//Here we check that $ok was not set to 0 by an error 
 
if ($ok==0
 { 
 Echo 
"Sorry your file was not uploaded"
 } 
 if (
file_exists("upload/" $_FILES["file"]["name"]))
      {
      echo 
$_FILES["file"]["name"] . " already exists. ";
      }
      
 
//If everything is ok we try to upload it 
 
else 
 { 
 if(
move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" $_FILES["file"]["name"])) 
 { 
    echo 
"The file "basename$_FILES['uploadedfile']['name']). " has been uploaded"
    echo 
"Upload: " $_FILES["file"]["name"] . "<br />";
    echo 
"Type: " $_FILES["file"]["type"] . "<br />";
    echo 
"Size: " $_FILES["file"]["size"] . " Kb<br />";
    echo 
"Temp file: " $_FILES["file"]["tmp_name"] . "<br />";


 
//$query= "INSERT INTO `mah1231201344051`.`wp_video` (`id`, `name`, `size`, `type`) VALUES (NULL, '$target', '$uploaded_size', '$uploaded_type')";
    //mysql_query($query) or die('Error, query failed');
        
 

 else 
 { 
 echo 
"Sorry, there was a problem uploading your file."
 } 
 } 


Thanks in advance