470,874 Members | 1,752 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,874 developers. It's quick & easy.

Opening a file or a url in the same script

I wrote this script to work on local files is there a way I can change
something here so
that I can add a url and run that through the script aswell?
<form action="<?= $PHP_SELF ?>" method="POST">
URL: <input type="text" name="url" value="<?= $url ?>"/><br>
<input type="submit">

// this is after the form is posted
$remote = fopen($url, 'r');
$html = fread($remote, 1048576);

The script is working I just want to add this functionality but I don't even
know how to go about looking something like this up. It seems to work
once in awhile but not consistently and I think it is the way it is opening
the webpage. If I copy the same page and run it on my machine as a local
file it always works.

Jul 17 '05 #1
0 1234

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by D. Alvarado | last post: by
1 post views Thread by Westbrook, Christopher L (WESTBCL04) | last post: by
4 posts views Thread by slawson7 | last post: by
14 posts views Thread by W Marsh | last post: by
5 posts views Thread by muwie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.