Well first you have my URL in the window.open function. But even still, you have to change some things in the upload.php that cuteseal posted. The first two lines are:
$URL = "http://www.ilovephysics.com/forum/images/upload/";
$maxsize = 153600
You have to move these lines after the first <?php and add a semicolon after 153600. Here is the upload.php that I have:
<html>
<head>
<title>ilovephysics.com :: Forums - image upload</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="keywords" content="physics, math, science">
<meta name="description" content="A community of Physics Phans!">
<title>Shuttertalk Forums / Help</title>
<link rel="stylesheet" type="text/css" href="../../style/Oxygen.css">
</head>
<body>
<table align="center" cellpadding="10">
<td bgcolor="#FFFFFF">
<?php
$URL = "http://www.ilovephysics.com/forum/images/upload/";
$maxsize = 153600;
if (isset($_POST['upload']))
{
//Check first if a file has been selected
$fileonserver = stripslashes($_FILES['uploaded']['name']);
$tmpfile = stripslashes($_FILES['uploaded']['tmp_name']);
while (file_exists($fileonserver))
{
$rand = rand(0, 99);
$file_name = $rand."_".$fileonserver;
$fileonserver = $file_name;
}
if (is_uploaded_file($tmpfile))
{
if ($_FILES['uploaded']['type'] == "image/pjpeg" || $_FILES['uploaded']['type'] == "image/jpeg" || $_FILES['uploaded']['type'] == "image/png" || $_FILES['uploaded']['type'] == "image/bmp" || $_FILES['uploaded']['type'] == "image/gif")
{
//Get the Size of the File
$size = $_FILES['uploaded']['size'];
//Make sure that $size is less than 150KB
if ($size > $maxsize)
{
//Print the error
echo '<b>File Too Large. Please try again.</b>';
echo '<p><a href="javascript:back()">Back</a>';
exit();
}
//Move the File to the Directory of your choice
if (move_uploaded_file($tmpfile,dirname($_SERVER['PATH_TRANSLATED']).'/'.$fileonserver))
{
//tell the user that the file has been uploaded
echo '<center><font size="3"><b>File Uploaded!</font></center><br>URL to file is:</b><br>';
echo $URL . rawurlencode($fileonserver);
echo '<br><b>Cut and paste this code into message:</b><br>';
echo '[img]'.$URL . rawurlencode($fileonserver).'[/img]';
exit();
}
else
{
//Print error
echo '<b>Unable to move the File</b>';
echo '<p><a href="javascript:back()">Back</a>';
exit();
}
}
else
{
//Print the error
echo '<b>You can only upload image files. Please try again.</b>';
echo '<p><a href="javascript:back()">Back</a>';
exit();
}
}
else
{
//Print error
echo '<b>No File Selected</b>';
echo '<p><a href="javascript:back()">Back</a>';
}
}
else {
?>
<form action="upload.php" method="post" enctype="multipart/form-data">
<b>Select an image file to upload (max 150KB):</b><br>
<input type="file" name="uploaded"><input type="Submit" value="Upload File">
<input type="hidden" name="upload" value="true">
</form>
<?php
}
?>
</td>
</table>
</body>
</html>