Jump to content

tagomago

Members
  • Posts

    33
  • Joined

  • Last visited

Everything posted by tagomago

  1. It all seems to work now! I think that it was just images from certain packages it didn't like so I have just suppressed warnings.
  2. Hi, I have been experiencing problems uploading PNG and BMP images, However this does not seem to occur with GIF and JPEG images and I cannot tell why. I get the following error message... Warning: imagecreatefrompng() [function.imagecreatefrompng]: 'uploads/USRIMG0000000002-1788589870.png' is not a valid PNG file in /home1/tagomago/public_html/misc/forum/forum_fun.php on line 92 Warning: imagecopyresized() expects parameter 2 to be resource, boolean given in /home1/tagomago/public_html/misc/forum/forum_fun.php on line 102 When I download the files from the server they are black or corrupted. The code I am using is as follows... $imagename = $_FILES['image']['name']; $imagetmp = $_FILES['image']['tmp_name']; $error = $_FILES['image']['error']; $uid = $_SESSION['userid']; if($uid && !$error) { //get extension $pos = stripos($imagename,'.'); if($pos) { $ext = substr($imagename ,$pos+1,strlen($imagename)-$pos-1); if(strncasecmp($ext,'GIF',3)==0 || strncasecmp($ext,'PNG',3)==0 || strncasecmp($ext,'BMP',3)==0 || strncasecmp($ext,'JPG',3)==0 || strncasecmp($ext,'JPEG',4)==0) { $target_path = createfilename($imagename,$uid); if(move_uploaded_file($imagetmp, $target_path)) { //resize image resize($target_path,$ext); //delete existing file $query = "SELECT image FROM users WHERE userid='".$uid."'"; $result = mysql_query($query) or die('Error: ' . mysql_error()); $line = mysql_fetch_array($result,MYSQL_ASSOC); unlink($line['image']); //update image $query = "UPDATE users SET image='".$target_path."' WHERE userid='".$uid."'"; mysql_query($query) or die('Error: ' . mysql_error()); } else{ echo "<script> alert('There was an error uploading the file, please try again!'); </script>"; } } else { echo "<script> alert('This image type is not supported'); </script>"; } } else { echo "<script> alert('This image type is not supported'); </script>"; } } else { echo "<script> alert('There was an error uploading the file, please try again!'); </script>"; } With resize function... function resize($file,$ext) { // get original size list($width, $height) = getimagesize($file); // calc new size $max = max($width,$height); $newwidth = $width*150/$max; $newheight = $height*150/$max; // Load $thumb = imagecreatetruecolor($newwidth, $newheight); if(strcasecmp($ext,'GIF')==0) $source = imagecreatefromgif($file); else if(strcasecmp($ext,'PNG')==0) $source = imagecreatefrompng($file); else if(strcasecmp($ext,'BMP')==0) $source = imagecreatefromwbmp($file); else if(strcasecmp($ext,'JPG')==0) $source = imagecreatefromjpeg($file); else if(strcasecmp($ext,'JPEG')==0) $source = imagecreatefromjpeg($file); // Resize imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); // Output if(strcasecmp($ext,'GIF')==0) imagegif($thumb,$file); else if(strcasecmp($ext,'PNG')==0) imagepng($thumb,$file); else if(strcasecmp($ext,'BMP')==0) imagewbmp($thumb,$file); else if(strcasecmp($ext,'JPG')==0) imagejpeg($thumb,$file); else if(strcasecmp($ext,'JPEG')==0) imagejpeg($thumb,$file); imagedestroy($thumb); } Any ideas?
  3. cPanel username: tagomago domain: javaprojects.heliohost.org url-mapped domain: ashleyhales.co.uk email: admin@ashley.javaprojects.heliohost.org server: stevie.heliohost.org I found a mail delivery failure email in inbox, below is header, hope this might help... This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed: halesashley@yahoo.co.uk SMTP error from remote mail server after MAIL FROM:<admin@ashley.javaprojects.heliohost.org> SIZE=2156: host mx-eu.mail.am0.yahoodns.net [188.125.69.79]: 553 5.7.1 [bL21] Connections will not be accepted from 65.19.143.2, because the ip is in Spamhaus's list; see http://postmaster.yahoo.com/550-bl23.html
  4. Hi, I have had a problem with the mail() function for quite some time. It does not seem to send any message to my inbox but the function always returns true. Does anyone understand what is going wrong here? I have checked for a couple of days after and the message never seems to arrive.
  5. I have registered a new domain name which I would like to use as the url for my helio page. I have already spoken support people from the domain server (GoDaddy) and they said that I need to register the nameservers for this server. They suggested that this is NS1.helionet.org and NS2.helionet.org. Is this it or do I need to do something to further to link my domain to my webpage?
×
×
  • Create New...