Simple PHP code: Newbie

Dear users,

I have the following function

Code:

<? $page = 0; $URL = "http://www.xxxxxxx.com/yyyyy.php/"; $page = @fopen($URL, "r");

And the function continues. I would like to exit the function if the above http://www.xxxxxxx.com/yyyyy.php/ does not exit. Because right now when I execute it for a non existing .PHP file it crashes my computer. I would really appreciate any help. Thank you.

P.S I have very little knowledge of PHP

Perhaps its possible to fetch the responce of the remote server to see if the page exists? For example, continue processing if the responce is HTTP 200, go into exception mode if not? And use a timeout of about 10 seconds?

Sponsor our Newsletter | Privacy Policy | Terms of Service