Jump to content

brianlange

Members
  • Posts

    243
  • Joined

  • Last visited

Everything posted by brianlange

  1. We I perform the curl request I get a bunch of jibberish returned. If I could get the html I'm sure I could parse it to get what you want. Here's what I am seeing ‹í=ërÚÈÒ¿×Uy‡‰rÛµw;†ÆNì=vÌYWΩ-j€I«‹Y6›úÞòëž];ö&9eg×FBÓÓÓÓÝÓÝÓÓ:|¾·Gþ;`Íøìí5žmžö.Îá/|âßM_4ñïÅI¯I¦®kí±?<í¦®´LÃe†»×[XL!CqUW\ö§››º3ý5N©í0·®9æ^­VÞßSÑIï¬w~ÒhA7¹º¼"ïL}”!üš9np‹&›Ì†AN>t.ÉiêºF!;Ì ØŒ¹”tÆêÊ5[ÌM{äDÐòNææœL¢²ÔdÄœ¡ Y®f‘VqÔHWsYöŠ‘)½aIJTÛ¶6dNöÈ[„÷ƦMºTgd®¹SÞn€mfßÀÄðu\¼7bºvÃìöBuÇ$–mÞh#FÆ6c¢—
  2. $headers = array("HTML\\1.0","HTML\\1.1"); $pattern = '/HTML\\\1\.[01]/'; $newHeaders = preg_replace($pattern, "", $headers); You have to escape the backslash in the subject and then use three backslashes in the pattern. You have to use a backslash before the period to escape it in the pattern, otherwise the period is treated as a special character, without the backslash it means any single character. The brackets around 0 and 1 mean either character will be matched. You could also add the start identifier ^ and end identifier $ to the pattern $pattern = '/^HTML\\\1\.[01]$/'; Without these the pattern the above will match strings like HTML\1.123456
  3. I have an email popping script that needs to remove embedded images. The images have "cid" in the source attribute like this one. <img width="83" height="95" src= "cid:image002.jpg@01CAC038.74744940" align="left" /> This is what I have so far which seems to work. Any way I can approve upon this? Thanks in advance. $regEx = '/<img[\w\W]+src=[\r\n]?["\']cid[\w\W]+\s(\/>|>)/'; $img = '<img width="83" height="95" src= "cid:image002.jpg@01CAC038.74744940" align="left" />'; $img = preg_replace($regEx, '', $img);
  4. Your thoughts on the website I work on www.RealTown.com Thanks, -Brian
  5. Thanks for the advice. I'll look into using Monit. I'm on a linux server. -Brian
  6. Also, is there a way to be notified by email when apache server goes down.
  7. I have a server that I use for our searching through a 300 megabyte text index. On this server apache goes down about every other day for no apparent reason. There's nothing unusual in the error files. When I restart apache everything works fine. When a search is performed it can take 20-30 seconds to return a result. Could this long of process cause apache to crash? There's not a lot of searches being performed so while each process can be intensive the server is not under very heavy load. Thanks in advance for any suggestions on how to go about trouble shooting this issue.
  8. I am trying to understand the regular expression in the jQuery library. /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/ Can someone put this into english for me? thanks.
  9. I have an online forum and have an issue where replies have a earlier `created` date than the first post in the thread. I need to query for all thread posts that have a reply with an earlier `created` date. I want to write a query like this "SELECT id, thread_id, created from posts where thread_id in (Sub query for replies order by created desc limit one and created is greater than the created value in the first post) Am I making sense? I know I could loop through all the records with php and check for this type of thing, but I was hoping to do it with a single query. Thanks.
  10. I want to dynamically block pp addresses. So that if I enter one into a database it is block from my site. What's the easiest way to do this. Right now I am editing the .conf file every time I want to block an address. This process is too time consuming. Thanks.
  11. No the script doesn't upload a file. It is a Imap email retrieving script. It does use curl to move the file from one server to another. There has to be something with the server configuration. ini_set("memory_limit") doesn't work at all. And the available memory is less than what is displayed on phpinfo();
  12. In php.ini I have the memory_limit set to 128M. A script I am running is running out of memory at 67M. What's going on here? I've tried using ini_set("memory") within the script but that doesn't seem to do anything? Thanks, -Brian
  13. I am using the Zend Framework Imap library. I was able to get it working. Thanks, -Brian
  14. When the user clicks on mainsite.com/download.php?id=100 a random md5 hash is stored in a database table that corresponds to the id 100. The url for on the main site will look like mainsite.com/download.php?id=86b7405c2efdf058ffd2b7e7b8f30256 Site2.com will be able to look up the hash and identify the id as 100. If the user tries to click on the url more than once on site2.com it wont work because the record in the db will be flagged as having been used. Maybe there is an easier way....but this will work. $_SERVER['http_referer'] is problematic and should not be relied on.
  15. I have a email script that pops email messages. I have now enabled attachment functionality. My question has to do with server performance. If I am going to make available large downloadable (up to 10mb) files available on already active website am I asking for trouble. Would the right server configuration solve this issue or should I look at storing all attachments on a separate server? Thanks, -Brian
  16. I have a script that retrieves emails and insert them into a database. How do I go about saving attachments and uploading them to the server. Thanks in advance. -Brian
×
×
  • 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.