PDA

View Full Version : Need Help!



DaveTaylor
04-03-2007, 10:46 PM
OK this is the script for my upload.php and PNG files are the problem they don't work in IE but they do in FF can anyone think of a reason why

<?
include "header.php";
?>
<?
include "config.php";
if (!isset($HTTP_POST_FILES['userfile'])) exit;
if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) {
if ($HTTP_POST_FILES['userfile']['size']>$ms) {
echo "Your File Size is too big, please reduce the size and try again.<br>\n"; exit; }
if(($HTTP_POST_FILES['userfile']['type']=="image/gif") ||
($HTTP_POST_FILES['userfile']['type']=="image/pjpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/jpeg") ||
($HTTP_POST_FILES['userfile']['type']=="image/jpg") ||
($HTTP_POST_FILES['userfile']['type']=="image/jpg") ||
($HTTP_POST_FILES['userfile']['type']=="image/bmp") ||
($HTTP_POST_FILES['userfile']['type']=="image/JPEG") ||
($HTTP_POST_FILES['userfile']['type']=="image/PNG") ||
($HTTP_POST_FILES['userfile']['type']=="image/png")) {
if (file_exists("./".$path . $HTTP_POST_FILES['userfile']['name'])) {
echo "File name exists please rename then try again.<br>\n"; exit; }
$zufall = rand(1,99999);
$fupl = "$zufall";
$res = copy($HTTP_POST_FILES['userfile']['tmp_name'], "./" .$path .$fupl .$HTTP_POST_FILES['userfile']['name']);
if (!$res) { echo "Upload Failed, please try again<br>\n"; exit; } else {
?>
<br>
<?php
//set url variable
$domst = "";
$drecks = "/";
$imgf = $fupl.$HTTP_POST_FILES['userfile']['name'];
$thbf = $tpath.$imgf;
$urlf = $domst .$domain .$drecks .$path .$imgf;
//create thumbnails
function LoadWBMP($imgname)
{
$im = @imagecreatefromwbmp($imgname); /* Attempt to open */
if (!$im) { /* See if it failed */
$im = imagecreatetruecolor (20, 20); /* Create a blank image */
$bgc = imagecolorallocate($im, 255, 255, 255);
$tc = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 10, 10, $bgc);
/* Output an errmsg */
imagestring($im, 1, 5, 5, "Error loading $imgname", $tc);
}
return $im;
}
?>
<table border='0'>
<link rel="STYLESHEET" type="text/css" href="style.css">
<center>
<FORM action="nowhere" method="post">
<center>
<tr><td><input type="text" name="thetext" style="width: 500px" size="70" value="&lt;a href=&quot;<?echo $url ;?>/v.php?id=<? echo $imgf; ?>&quot;&gt;&lt;img src=&quot;<?echo $url ;?>/images<? echo $domst.$domain.$drecks.$tpath.$imgf; ?>&quot; border=&quot;0&quot /&gt;&lt;/a&gt;"><td>
Thumbnail for Websites</td></td></tr>
<tr><td><input type="text" name="thetext" style="width: 500px" size="70" value="<?echo $url ;?>/images<? echo $domst.$domain.$drecks.$tpath.$imgf; ?> (<?echo $url ;?>/v.php?id=<? echo $imgf; ?>)"><td>

Thumbnail for forums (1)</td></td></tr>
<tr><td><input type="text" name="thetext" style="width: 500px" size="70" value=" (<?echo $url ;?>/v.php?id=<? echo $imgf; ?>)"><td>

Thumbnail for forums (2)</td></td></tr>
<tr><td><input type="text" name="thetext" style="width: 500px" size="70" value="Thanks to <?echo $name;?> for &lt;a href=&quot;<?echo $url ;?>&quot;&gt;Free Image Hosting&lt;/a&gt;"><td>
Link back to <a href="<?echo $url ;?>"><?echo $name ;?></a></td></td></tr>
<tr><td><input type="text" name="thetext" style="width: 500px" size="70" value="[IMG]<?echo $url ;?><? echo $domst.$domain.$drecks.$tpath.$imgf; ?> (<?echo $url ;?>)"><td>

Hotlink for forums (1)</td></td></tr>
<tr><td><input type="text" name="thetext" style="width: 500px" size="70" value="[img=<?echo $url ;?>/images<? echo $domst.$domain.$drecks.$tpath.$imgf; ?>] (<?echo $url ;?>)"><td>
Hotlink for forums (2)</td></td></tr>
<tr><td><input type="text" name="thetext" style="width: 500px" size="70" value="&lt;a href=&quot;<?echo $url ;?>&quot;&gt;&lt;img src=&quot;<?echo $url ;?>/images<? echo $domst.$domain.$drecks.$tpath.$imgf; ?>&quot; border=&quot;0&quot /&gt;&lt;/a&gt;"><td>
Hotlink for Websites</td></td></tr>
<tr><td><input type="text" name="thetext" style="width: 500px" size="70" value='<?echo $url ;?>/v.php?id=<? echo $imgf; ?>'><td>
<a href="<?echo $url ;?>/v.php?id=<? echo $imgf; ?>"><b>Show</b></a> image to friends</td></td></tr>
<tr><td><input type="text" name="thetext" style="width: 500px" size="70" value="<?echo $url ;?><? echo $urlf; ?>"><td>Direct link to image</td></tr>
<BR>

<a href="<?echo $url ;?>/v.php?id=<? echo $imgf; ?>"><img src="<?echo $url ;?><? echo $urlf; ?>" alt="iNetScripts" border="0" height="31" width="88" /></a> Click <a href="<?echo $url ;?>/v.php?id=<? echo $imgf; ?>">HERE</a> to view image</td></td><BR>
<?
}
} else { echo "Sorry we dont allow that file type.!<br>Please go back and try again!\n"; exit; }
}
?>
</table>
<br><br>
</body></center>
<center><?
include "adverts.php";
?></center><BR><?
include "footer.php";
?>

F32
04-03-2007, 10:53 PM
IE doesn't support transparency.

DaveTaylor
04-03-2007, 11:02 PM
its fixed IE shows it as x-png thats all sorry thread can get closed :P

Want to hide these adverts? Register an account for free!