<body>
<form enctype="multipart/form-data" action="<?php $PHP_SELF ?>" method="post">
<input type="hidden" name="MAX_FILE_UPLOAD" value="204800"><br />
upload a jpg<br />
<input type="file" name="userfile"><br />
<input type="submit" name="done" value="upload file">
<?php
if(isset($_POST['done'])){
if($_FILES['userfile']['tmp_name']=="none"){
echo"<br />";
echo "try again";
exit();
}else{
$target = "uploads";
$my_file = $_FILES['userfile']['name'];
$ext = strrchr($my_file,'.');
if($ext == ".jpg"){
copy($_FILES['userfile']['tmp_name'], "$target/$my_file");
echo "<br />";
echo "$my_file uploaded!";
//
//take me somewhere else!!
//
} else{
echo "<br />";
echo "not a jpg, try again";
}
}
}
?>
</form>
</body>
this code uploads a file, and makes sure it's a jpg
then I'd like it to go to a new url (and send a variable: the name of the jpg)
I have no idea how to do this...
do you?
😉