panoramical
02-27-2005, 11:54 AM
For some reason, in my upload script, some files don't work, whereas others do. Is it perhaps to do with php.ini, and if it is, how can I modify it?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style type="text/css">
input.form
{
background-color: #B6D172;
font-family: Arial;
vertical-align: bottom
}
input.form:hover
{
background-color: #50563F;
font-family: Arial;
}
</style>
</head>
<body style="background-color: #999; font-family: Arial; font-size: 10px">
<img src="logo.jpg"
style="border: 1px solid #000"><p>
<form enctype="multipart/form-data" action="" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
Send this file: <input name="userfile" type="file" class="form"/><br>
Desired Width: <input name="width" type="text" class="form"/><br>(height
will automatically scale)<br>
<input type="submit" value="Send File" class="form" />
</form>
<?php
$uploaddir = '/home/mariokartruk/public_html/uploads/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
$name = basename($_FILES['userfile']['name']);
$width3 = $_POST['width'];
$px = px;
$width = $width3 . $px;
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "Here is your image: <br/><img src=\"/uploads/$name\"><br/>";
echo '<br>Here is the result of your code in eBay:<br>';
echo "<a href=\"http://www.mariokartresource.co.uk/uploads/$name\">
<img src=\"http://www.mariokartresource.co.uk/uploads/$name\"
alt=\"no\" style=\"width: $width; border: 1px solid #000\"/></a>";
echo '<br>Copy this code out into eBay where you want the image link:<br><xmp>';
echo "<a href=\"http://www.mariokartresource.co.uk/uploads/$name\">
<img src=\"http://www.mariokartresource.co.uk/uploads/$name\"
alt=\"no\" style=\"width: $width; border: 1px solid #000\"/></a>";
echo '</xmp>';
}
elseif ($name=="") {
echo 'Please enter the correct filename';
}
else {
echo 'Failed';
}
?>
</body>
</html>
http://www.mariokartresource.co.uk/upload.php
Thanks
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style type="text/css">
input.form
{
background-color: #B6D172;
font-family: Arial;
vertical-align: bottom
}
input.form:hover
{
background-color: #50563F;
font-family: Arial;
}
</style>
</head>
<body style="background-color: #999; font-family: Arial; font-size: 10px">
<img src="logo.jpg"
style="border: 1px solid #000"><p>
<form enctype="multipart/form-data" action="" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
Send this file: <input name="userfile" type="file" class="form"/><br>
Desired Width: <input name="width" type="text" class="form"/><br>(height
will automatically scale)<br>
<input type="submit" value="Send File" class="form" />
</form>
<?php
$uploaddir = '/home/mariokartruk/public_html/uploads/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
$name = basename($_FILES['userfile']['name']);
$width3 = $_POST['width'];
$px = px;
$width = $width3 . $px;
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "Here is your image: <br/><img src=\"/uploads/$name\"><br/>";
echo '<br>Here is the result of your code in eBay:<br>';
echo "<a href=\"http://www.mariokartresource.co.uk/uploads/$name\">
<img src=\"http://www.mariokartresource.co.uk/uploads/$name\"
alt=\"no\" style=\"width: $width; border: 1px solid #000\"/></a>";
echo '<br>Copy this code out into eBay where you want the image link:<br><xmp>';
echo "<a href=\"http://www.mariokartresource.co.uk/uploads/$name\">
<img src=\"http://www.mariokartresource.co.uk/uploads/$name\"
alt=\"no\" style=\"width: $width; border: 1px solid #000\"/></a>";
echo '</xmp>';
}
elseif ($name=="") {
echo 'Please enter the correct filename';
}
else {
echo 'Failed';
}
?>
</body>
</html>
http://www.mariokartresource.co.uk/upload.php
Thanks