Jump to content

mmssix

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mmssix's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I don't mean to sound callous, but move to another webhost. It would be the easiest and simplest solution to your problem. I've had good luck in the past with hostgator and hostpc
  2. Remove all the meta info from the other pages that are included and put the meta info into a separate "include" page. Then simply put that include into the header info on each page. Simple workaround and will not necessitate a full scale recoding. Current: <head> some stuff including meta info </head> <body> ?php(include'pageheader.html'); ?php(incldue'pagebody.html'); ?php(include'someothercrap.html'); </body> Meta.php page: <?php $meta = '<title>MyPage.com</title> <meta http-equiv="Content-Type" content="text/html charset=UTF-8">'; ?> New html page: <?php require('includes/meta.php'); ?> <head> <?php echo $meta; ?> </head> <body> ?php(include'pageheader.html'); ?php(incldue'pagebody.html'); ?php(include'someothercrap.html'); </body> Do that for each page that needs fixing. Again just quick and dirty, not necessarily the right way to fix it.
  3. First off I just want to say that you guys have been a great help. I've been dabbling in PHP for a while now and it seems that whenever i cant figure something out I can always find the answer here, many thanks. Now down to business, as it were... I found this cool little class on phpclasses.org that signs into a pop account, grabs any attachments that are in the inbox, and then saves them to a file in my webspace. The problem is this: when an email with attachment is sent from a regular mail account (thunderbird, yahoo, gmail, etc) the script works fine, but when I try to text a pic from my phone(verizon or BB), it refuses to work. Now I think I have the problem narrowed down to how the attachment is added to the email, as gmail uses the line: Content-Type: image/jpeg; name="arm.jpg" Content-Disposition: attachment; filename="arm.jpg" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fzgggofj0 But when it comes from the cell that part of the email looks like this: Content-Type: image/jpeg; name="arm.jpg" Content-ID: <arm.jpg> Content-Location: arm.jpg Content-Transfer-Encoding: base64 x-drm: forward I'm not totaly sure but i think the problem is how the script looks for an attachment around line 54. If anyone has an idea it would be greatly appreciated. Here is the class: <?php # Coded By Jijo Last Update Date [Jan/19/06] (http://www.phpclasses.org/browse/package/2964.html) # Updated 2008-12-18 by Dustin Davis (http://nerdydork.com) # Utilized $savedirpath parameter # Added delete_emails parameter class ReadAttachment { function getdecodevalue($message,$coding) { switch($coding) { case 1: $message = imap_8bit($message); break; case 2: $message = imap_binary($message); break; case 3: $message=imap_base64($message); break; case 4: $message = imap_qprint($message); break; } return $message; } function getdata($host,$login,$password,$savedirpath,$delete_emails=false) { // make sure save path has trailing slash (/) $savedirpath = str_replace('\\', '/', $savedirpath); if (substr($savedirpath, strlen($savedirpath) - 1) != '/') { $savedirpath .= '/'; } $mbox = imap_open ($host, $login, $password) or die("can't connect: " . imap_last_error()); $message = array(); $message["attachment"]["type"][0] = "text"; $message["attachment"]["type"][1] = "multipart"; $message["attachment"]["type"][2] = "message"; $message["attachment"]["type"][3] = "application"; $message["attachment"]["type"][4] = "audio"; $message["attachment"]["type"][5] = "image"; $message["attachment"]["type"][6] = "video"; $message["attachment"]["type"][7] = "other"; for ($jk = 1; $jk <= imap_num_msg($mbox); $jk++) { $structure = imap_fetchstructure($mbox, $jk , FT_UID); $parts = $structure->parts; $fpos=2; for($i = 1; $i < count($parts); $i++) { $message["pid"][$i] = ($i); $part = $parts[$i]; if($part->disposition == "ATTACHMENT") { $message["type"][$i] = $message["attachment"]["type"][$part->type] . "/" . strtolower($part->subtype); $message["subtype"][$i] = strtolower($part->subtype); $ext=$part->subtype; $params = $part->dparameters; $filename=$part->dparameters[0]->value; $mege=""; $data=""; $mege = imap_fetchbody($mbox,$jk,$fpos); $filename="$filename"; $fp=fopen($savedirpath.$filename,w); $data=$this->getdecodevalue($mege,$part->encoding); fputs($fp,$data); fclose($fp); $fpos+=1; } } if ($delete_emails) { // imap_delete tags a message for deletion imap_delete($mbox,$jk); } } // imap_expunge deletes all tagged messages if ($delete_emails) { imap_expunge($mbox); } imap_close($mbox); } }
  4. Leave us your ip and we can check it for you. P.S. make sure u have a index file so there is a page to pull up
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.