Re-JeeP Posted July 14, 2006 Share Posted July 14, 2006 Hi!I have a problem with a script that i'm creating to se if a mailserver is blacklisted.[code]<?php $file = file_get_contents("http://www.mail-abuse.com/cgi-bin/lookup?ip_address=81.228.8.29"); print_r($file);?>[/code]I get this message[quote="error mess"]Warning: file_get_contents(http://www.mail-abuse.com/cgi-bin/lookup?ip_address=81.228.8.29) [function.file-get-contents]: failed to open stream: HTTP request failed! in /www/bl/index.php on line 2[/quote]Have I done something wrong or can't I solve my problem like this?Thanks!// Johan Quote Link to comment https://forums.phpfreaks.com/topic/14598-check-if-a-mailserver-is-blacklisted/ Share on other sites More sharing options...
Oldiesmann Posted July 14, 2006 Share Posted July 14, 2006 "HTTP request failed" most likely means it couldn't load the website. Besides - file_get_contents loads the contents into a string, not an array, so print_r wouldn't work (either use echo or print).What problem are you trying to solve here? It doesn't take that long to look that info up. Quote Link to comment https://forums.phpfreaks.com/topic/14598-check-if-a-mailserver-is-blacklisted/#findComment-57998 Share on other sites More sharing options...
kenrbnsn Posted July 14, 2006 Share Posted July 14, 2006 I just tried that URL in my web browser and it took awhile to return. It could be a timing issue with PHP timing out while waiting for a response.Ken Quote Link to comment https://forums.phpfreaks.com/topic/14598-check-if-a-mailserver-is-blacklisted/#findComment-58001 Share on other sites More sharing options...
Re-JeeP Posted July 14, 2006 Author Share Posted July 14, 2006 Thats possible...Is there any other way to solve this?[quote]What problem are you trying to solve here? It doesn't take that long to look that info up.[/quote]what do you mean?I wan't to se if a mailserver is blacklisted at mail-abuse.com Quote Link to comment https://forums.phpfreaks.com/topic/14598-check-if-a-mailserver-is-blacklisted/#findComment-58005 Share on other sites More sharing options...
Oldiesmann Posted July 14, 2006 Share Posted July 14, 2006 I understand what you want to do, but don't understand why you need a PHP script to do that. It doesn't take that long to look up an IP address on that site. Quote Link to comment https://forums.phpfreaks.com/topic/14598-check-if-a-mailserver-is-blacklisted/#findComment-58008 Share on other sites More sharing options...
Re-JeeP Posted July 14, 2006 Author Share Posted July 14, 2006 Ok. I have a site that look up info about a domain.It checks dns (MX, NS, CNAME) and so on and I wanted a function that checks mailservers in that list. Quote Link to comment https://forums.phpfreaks.com/topic/14598-check-if-a-mailserver-is-blacklisted/#findComment-58011 Share on other sites More sharing options...
kenrbnsn Posted July 14, 2006 Share Posted July 14, 2006 Put a [code]<?php set_time_limit(0); ?>[/code] at the top of your script. This will prevent your script from timing out after 30 seconds.It worked for me.BTW, the print_r function works fine with non-array variables.Ken Quote Link to comment https://forums.phpfreaks.com/topic/14598-check-if-a-mailserver-is-blacklisted/#findComment-58012 Share on other sites More sharing options...
Re-JeeP Posted July 14, 2006 Author Share Posted July 14, 2006 [quote author=kenrbnsn link=topic=100579.msg397129#msg397129 date=1152896866]Put a [code]<?php set_time_limit(0); ?>[/code] at the top of your script. This will prevent your script from timing out after 30 seconds.It worked for me.[/quote]Dosen't work. My PHP runs in safe-mode! Quote Link to comment https://forums.phpfreaks.com/topic/14598-check-if-a-mailserver-is-blacklisted/#findComment-58013 Share on other sites More sharing options...
kenrbnsn Posted July 14, 2006 Share Posted July 14, 2006 Find another host, one that trusts their users more.Ken Quote Link to comment https://forums.phpfreaks.com/topic/14598-check-if-a-mailserver-is-blacklisted/#findComment-58017 Share on other sites More sharing options...
Re-JeeP Posted July 14, 2006 Author Share Posted July 14, 2006 Hehe.... just registerd a new webhotell for a year...But did the script work for you when you add the time out function? Quote Link to comment https://forums.phpfreaks.com/topic/14598-check-if-a-mailserver-is-blacklisted/#findComment-58020 Share on other sites More sharing options...
kenrbnsn Posted July 14, 2006 Share Posted July 14, 2006 With the time limit set to 0 (infinate) the script worked fine.Ken Quote Link to comment https://forums.phpfreaks.com/topic/14598-check-if-a-mailserver-is-blacklisted/#findComment-58023 Share on other sites More sharing options...
Re-JeeP Posted July 14, 2006 Author Share Posted July 14, 2006 Ok. Thanks alot for the help! Quote Link to comment https://forums.phpfreaks.com/topic/14598-check-if-a-mailserver-is-blacklisted/#findComment-58024 Share on other sites More sharing options...
Re-JeeP Posted July 14, 2006 Author Share Posted July 14, 2006 [quote author=kenrbnsn link=topic=100579.msg397143#msg397143 date=1152897627]With the time limit set to 0 (infinate) the script worked fine.Ken[/quote]Hi again!I tried the script at home but did'nt get it to work all the time.I clocked it and if it timed out it stopped at about 75 sec.Same error mess... Quote Link to comment https://forums.phpfreaks.com/topic/14598-check-if-a-mailserver-is-blacklisted/#findComment-58108 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.