Page 1 of 1

Doubt on fopen

Posted: Tue Feb 24, 2009 3:54 am
by dezrock
Hi Developers,

I need to evoke a URL using fopen. I tried several ways... I can echo the link just above the fopen without any trouble...

I'm using like this...

$link = "...URL Here...";
$handle = fopen("$link", "r");
if ($handle....
....
....


If I echo the link, I can see the correct link... If I copy and paste that echoed link, my need is served.... I need to evoke the link and if its a success, then I need to direct it the success page, else failed page.

Any help will be appreciated...

Re: Doubt on fopen

Posted: Wed Feb 25, 2009 9:04 am
by Yossarian

Code: Select all

$handle = fopen($link, "r");
$link does not need to be quoted.

Whether PHP will actually do this for you will depend on some settings in your ini file.

safe_mode
allow_url_fopen

Amongst the most likely suspects. Turning on error reporting would give you some messages.

What you are proposing should be viewed as being inherently dangerous unless you know exactly what is in that file.