I need help making this script work. For some reason, it won't let me upload the files. I took this script from a thread on here and modified it but it still doesn't work. Any ideas? The error says it is on line 25 and I have no clue what might be wrong there.
PHP:
<?php
if($_POST[finshed] == '1') {
$upload_dir = "images/";
$max_size = 1024000;
if(is_uploaded_file($_FILES['image']['tmp_name']))
{
$size = $_FILES['image']['size'];
if($size > $max_size)
{
echo "File Too Large. File must be no larger than <b>$max_size</b> bytes.";
exit();
}
$filename = $_FILES['image']['name'];
if(file_exists($upload_dir.$filename))
{
echo "Error: The file named <b>$filename</b> already exists.";
exit();
}
if(move_uploaded_file($_FILES['image']['tmp_name'], $upload_dir.$filename))
{
echo "Your image uploaded successfully!<br />
<input type=\"text\" onClick='highlight(this);' style=\"width: 500px\" size=\"70\" value=\"[URL=http://atyourhost.com][IMG]http://www.atyourhost.com/\".$upload_dir.$filename.\"[/IMG][/URL]\" /> Forum Hotlink 1<br /><br />
<input type=\"text\" onClick='highlight(this);' style=\"width: 500px\" size=\"70\" value=\"[url=http://imageshack.us][img=http://www.atyourhost.com/\".$upload_dir.$filename.\"][/url]\" /> Forum Hotlink 2<br /><br />
<input type=\"text\" onClick='highlight(this);' style=\"width: 500px\" size=\"70\" value=\"http://www.atyourhost.com/\".$upload_dir.$filename.\"\" /> Direct Link<br /><br />"";
exit();
}
else
{
echo "There was a problem uploading your file. Please try again.";
exit();
}
}
}else{
?>
<html>
<head>
<title>Image upload</title>
</head>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="finshed" value="1">
Image: <input type="file" name="image" size="20">ย
<input type="submit" name="submit" value="Upload">
</form>
</body>
</html>
<?php } ?>








