Umm, I got a file_get_contents function that get contents from a site depending on a variable in the url, if the variable makes a url that referrs to a site that doesn’t exist and which will return a 404 error.. I wondered how I could display for example: “Please enter a valid username!” instead of:
[code=php]Warning: file_get_contents(http://hiscore.runescape.com/index_lite.ws?player=ordbogk4) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not found in C:xampphtdocstehcalcsaction.php on line 10
The syntax I’m using is:
[code=php]$stats = file_get_contents(‘http://hiscore.runescape.com/index_lite.ws?player=’.$rsn);