Page 1 of 1

allow_url_fopen - Work around

Posted: Tue May 26, 2009 9:10 pm
by Ronnie
Script URL:http://www.momnpopsware.com/linkman/links.php
Version of script:1.7
Hosting company: sitegenie
URL of phpinfo.php:
URL of session_test.php:http://www.momnpopsware.com/linkman/links.php
What terms did you try when SEARCHING for a solution:
allow_url_fopen / allow_url_fopen workaround
Write your message below:
Hi Klemen - I love your script and thanks for the great work. My IP provide does not allow allow_url_fopen, and I was wondering if there was a work around. I am not certain what the function does and is there a way to maybe by pass the function and do the work manually? I noticed a fix for Linkman 1.05 in the support forum but, don't know if it will work with the recent script. Thanks, I would love to get the script working and register the product. Ronnie

Posted: Tue May 26, 2009 11:02 pm
by DC
You have posted this under Hesk, I think you wanted to post it under LinkMan No?

Here's how I would do somthing like this.
This is not totally tested but as far as a curl workaround I would think you can do somthing like this and it should work ...


Add my func to the end of the addlink.php

//DC fopen mod ...
function get_url($url_data){
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url_data);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 10);
$get_data = curl_exec($ch);
curl_close($ch);
return $get_data;
}

then where the script makes a call like
/* Get HTML code of the reciprocal link URL */
$html = @file_get_contents($recurl) or problem('Can\'t open remote URL!');

you would replace that with
$html = get_url($recurl);

Klem you might want to move these 2 posts.

DC

Posted: Wed May 27, 2009 5:47 am
by Klemen
Moved to LinkMan.

I'll add cURL support in the next official version.

Regards,

Posted: Wed May 27, 2009 8:22 pm
by Ronnie
Txs...and sorry for posting in wrong forum.

Posted: Sat May 30, 2009 9:54 pm
by Ronnie
Txs again, I still get the same "ERROR Can't open remote URL!." Any help would be appreciated. Ronnie

Posted: Sat May 30, 2009 10:01 pm
by DC
Hi do you have curl support on your server? if you do my code should work.

DC

Posted: Sun May 31, 2009 10:24 am
by Ronnie
Thanks again for your help. cURL support is enabled. Any suggestion would be appreciated. Ronnie

Posted: Sun May 31, 2009 12:12 pm
by Ronnie
Thanks - Its Working!!! My mistake was that I did not change

$html = @file_get_contents($recurl) or problem('Can\'t open remote URL!');

to

$html = get_url($recurl);

Thanks for your help. Ronnie