allow_url_fopen - Work around

Problems installing LinkMan?
Post Reply
Ronnie
Posts: 17
Joined: Sun Apr 26, 2009 7:40 pm

allow_url_fopen - Work around

Post 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
DC
Posts: 138
Joined: Sun Dec 09, 2007 9:28 am

Post 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
To Code Or Not To Code That Is The Question?

Was my post of any help to you? if so please do [url=http://www.clickcraft.net/slice_donations.php][b]Buy Me A Slice[/b][/url] ...
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Moved to LinkMan.

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

Regards,
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Ronnie
Posts: 17
Joined: Sun Apr 26, 2009 7:40 pm

Post by Ronnie »

Txs...and sorry for posting in wrong forum.
Ronnie
Posts: 17
Joined: Sun Apr 26, 2009 7:40 pm

Post by Ronnie »

Txs again, I still get the same "ERROR Can't open remote URL!." Any help would be appreciated. Ronnie
DC
Posts: 138
Joined: Sun Dec 09, 2007 9:28 am

Post by DC »

Hi do you have curl support on your server? if you do my code should work.

DC
To Code Or Not To Code That Is The Question?

Was my post of any help to you? if so please do [url=http://www.clickcraft.net/slice_donations.php][b]Buy Me A Slice[/b][/url] ...
Ronnie
Posts: 17
Joined: Sun Apr 26, 2009 7:40 pm

Post by Ronnie »

Thanks again for your help. cURL support is enabled. Any suggestion would be appreciated. Ronnie
Ronnie
Posts: 17
Joined: Sun Apr 26, 2009 7:40 pm

Post 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
Post Reply