Jump to content

Check if a mailserver is blacklisted


Re-JeeP

Recommended Posts

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
Link to comment
Share on other sites

"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.
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

[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!
Link to comment
Share on other sites

[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...
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.