Doubt on fopen

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
dezrock
Forum Newbie
Posts: 2
Joined: Tue Feb 24, 2009 3:51 am

Doubt on fopen

Post 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...
Yossarian
Forum Contributor
Posts: 101
Joined: Fri Jun 30, 2006 4:43 am

Re: Doubt on fopen

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