Hope this post is not inappropriate. As far as php coding goes… i’m just about dumb as a rock. :-[
I need to modify this code. As it is now, after a file or multiple files have been uploaded successfully, the user gets a one line message saying “Your file(s) have been received.” repeated as many times as the number of files uploaded. What I need to happen after a successful upload is to have the user sent to support.jkbsystems.com in a popup window with w=1000 h=800. Can… well “can” is the wrong word… will someone help me out here?
[php]
<?php $error_message[0] = "Unknown problem with upload."; $error_message[1] = "Uploaded file too large (load_max_filesize)."; $error_message[2] = "Uploaded file too large (MAX_FILE_SIZE)."; $error_message[3] = "File was only partially uploaded."; $error_message[4] = "Choose a file to upload."; $upload_dir = './pictures/'; $num_files = count($_FILES['upload']['name']); for ($i=0; $i < $num_files; $i++) { $upload_file = $upload_dir . urlencode(basename($_FILES['upload']['name'][$i])); if (!preg_match("/(gif|jpg|jpeg|png)$/",$_FILES['upload']['name'][$i])) { print "Only file types gif, jpg, jpeg, and png allowed. Press you BACK button and try again."; } else { if (@is_uploaded_file($_FILES['upload']['tmp_name'][$i])) { if (@move_uploaded_file($_FILES['upload']['tmp_name'][$i], $upload_file)) { /* Great success... */ echo "Your file(s) have been received."; //$content = file_get_contents($upload_file); //print $content; } else { print $error_message[$_FILES['upload']['error'][$i]]; } } else { print $error_message[$_FILES['upload']['error'][$i]]; } } } ?>[/php]