Forge
13-02-2008, 10:33 AM
Hey as you might of guessed im making a free opensource image upload system. You may be thinking why is he having problems? Hes made one before!
This is using a different feature as when an image is uploaded it is named using time(); (so that images with the same name can be uploaded)
The image uploads fine but in the imagesource and the given link shows the name to the file twice.
e.g.
Filename
1234
Given link
12341234
Any ideas on how to fix this?
upload.php code
<?php
$iuspath = "http://www.devode.zzl.org/php/IUS/";
$image = $_FILES['image']['name'];
$imagesize = $_FILES['image']['size'];
$imagetype = $_FILES['image']['type'];
$urlextension = time();
$image = $urlextension;
$uploadpath = "uploads/". $image;
if ($imagesize<2048 && ereg("image", $imagetype))
{ move_uploaded_file($_FILES['image']['tmp_name'], $uploadpath);}
$folderlocation = $iuspath. $uploadpath;
$imagelocation = $folderlocation. $image;
echo("
<html>
<head>
<title>IUS | $image</title>
<link rel='stylesheet' href='css/default.css' />
</head>
<body>
<center>
<div id='container'>
<div id='logo'></div>
<div id='boxtop'></div>
<div id='boxmid'>
<a href='$imagelocation' target='_blank'>
<img src='$imagelocation' style='border: 1px solid #000000; width: 75px; height: 75px;'>
</a><br />
Click image to enlarge<br /><br />
Direct link: <input type='text' name='directlink' value='$imagelocation' size='50' />
</div>
<div id='boxbtm'></div>
</div>
</center>
</body>
</html>
");
?>
Thanks
- Luke
This is using a different feature as when an image is uploaded it is named using time(); (so that images with the same name can be uploaded)
The image uploads fine but in the imagesource and the given link shows the name to the file twice.
e.g.
Filename
1234
Given link
12341234
Any ideas on how to fix this?
upload.php code
<?php
$iuspath = "http://www.devode.zzl.org/php/IUS/";
$image = $_FILES['image']['name'];
$imagesize = $_FILES['image']['size'];
$imagetype = $_FILES['image']['type'];
$urlextension = time();
$image = $urlextension;
$uploadpath = "uploads/". $image;
if ($imagesize<2048 && ereg("image", $imagetype))
{ move_uploaded_file($_FILES['image']['tmp_name'], $uploadpath);}
$folderlocation = $iuspath. $uploadpath;
$imagelocation = $folderlocation. $image;
echo("
<html>
<head>
<title>IUS | $image</title>
<link rel='stylesheet' href='css/default.css' />
</head>
<body>
<center>
<div id='container'>
<div id='logo'></div>
<div id='boxtop'></div>
<div id='boxmid'>
<a href='$imagelocation' target='_blank'>
<img src='$imagelocation' style='border: 1px solid #000000; width: 75px; height: 75px;'>
</a><br />
Click image to enlarge<br /><br />
Direct link: <input type='text' name='directlink' value='$imagelocation' size='50' />
</div>
<div id='boxbtm'></div>
</div>
</center>
</body>
</html>
");
?>
Thanks
- Luke