cip6791 Posted April 15, 2007 Share Posted April 15, 2007 Hello i want to upload pics here -->http://sportnonstop.net/europe/spain/images/football/barcelona/index.php If i upload with internet explorer , everything is ok ... but when i try uploading with firefox, the pics won t upload. Anybody have any idea why ? thanks Link to comment https://forums.phpfreaks.com/topic/47104-upload-help/ Share on other sites More sharing options...
mendoz Posted April 15, 2007 Share Posted April 15, 2007 This was easy man, check line 37 nope? Post the code and it'll be easier Link to comment https://forums.phpfreaks.com/topic/47104-upload-help/#findComment-229718 Share on other sites More sharing options...
cip6791 Posted April 15, 2007 Author Share Posted April 15, 2007 <?php // //## You can find the configuration after the resizeimage function... ## // function resizeimage($imgurl,$maxw,$maxh,$orx,$ory,$itype,$succes){ $tmpimg = @imagecreatetruecolor($maxw,$maxh); if ($itype==1) { if (function_exists("imagegif")) { $initial = imagecreatefromgif($imgurl); if (imagecopyresized($tmpimg,$initial,0,0,0,0,$maxw,$maxh,$orx,$ory)==1) { imagegif($tmpimg,$imgurl,100); imagedestroy($tmpimg); imagedestroy($initial); @header("Location: ".$succes); exit; } else { unlink($imgurl); }} else { unlink($imgurl); echo('<B>EROARE</B>: Nu exista functia <I>imagegif()</I>!'); exit; }; } else { $initial = imagecreatefromjpeg($imgurl); if (imagecopyresized($tmpimg,$initial,0,0,0,0,$maxw,$maxh,$orx,$ory)==1) { imagejpeg($tmpimg,$imgurl,100); imagedestroy($tmpimg); imagedestroy($initial); @header("Location: ".$succes); exit; } else { unlink($imgurl); } } } // ## CONFIGURATION STARTS HERE: ## $directorfisieregif='gifs/'; // ## .gif file directory here ## $directorfisierejpg='jpgs/'; // ## .jpg file directory here ## $resize=1; // ## 1=true,0=false. If true then file resizing will be enabled. ## $maxx=1024; //## max width of a file ## $maxy=768; // ##max height of a file ## $pagupload='html/uploadform.html'; //## this is the redirection the your uploadform ## $pagdupapost='index.php'; //## this is the redirection after a succesfully upload of a file ## $pagrongrez='html/rongrez.html'; //## redirection in case of rong rezolution(only if resize disabled) ## $pageexists='html/exists.html'; //## redirection if file allready exists on server ## $pageview='index.php'; // ## this is the script for thumbnails creation ## // ## CONFIGURATION ENDS HERE ## $actiune=trim($_GET['do']); if ($actiune=="") {@header("Location: http://www.sportnonstop.net");} else if ($actiune=="upload"){ if ($_FILES['userfile']['type'] == 'image/gif'){ if (file_exists($directorfisieregif.$_FILES['userfile']['name'])) {@header("Location: ".$pageexists); exit;} @move_uploaded_file($_FILES['userfile']['tmp_name'],$directorfisieregif.$_FILES['userfile']['name']); $result=$directorfisieregif.$_FILES['userfile']['name']; $imgtype=1; } else if ($_FILES['userfile']['type'] == 'image/pjpeg'){ if (file_exists($directorfisierejpg.$_FILES['userfile']['name'])) {@header("Location: ".$pageexists); exit;} @move_uploaded_file($_FILES['userfile']['tmp_name'],$directorfisierejpg.$_FILES['userfile']['name']); $result=$directorfisierejpg.$_FILES['userfile']['name']; $imgtype=2; } else {exit;}; list($width, $height, $type, $attr)= getimagesize($result); if ($width<$maxx){@header("Location: ".$pagdupapost); exit; } else if ($width>$maxx) { if ($resize==1) { resizeimage($result,$maxx,$maxy,$width,$height,$imgtype,$pagdupapost);} else { @header("Location: ".$pagrongrez); unlink($result); exit; } } else { if ($height<$maxy){@header("Location: ".$pagdupapost); exit; } else if ($height>$maxy) { if ($resize==1) { resizeimage($result,$maxx,$maxy,$width,$height,$imgtype,$pagdupapost);} else { @header("Location: ".$pagrongrez); unlink($result); exit; } }} } else if ($actiune=="uploadform") {@header("Location: ".$pagupload); } else if ($actiune=="viewform") {@header("Location: ".$pageview);}; ?> Link to comment https://forums.phpfreaks.com/topic/47104-upload-help/#findComment-229730 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.