PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
if (isset($_POST['Submit'])){
$url=$_POST['ads'];
$newfile = 'tmp.txt';
if (!copy($url, $newfile)) {
echo "failed to copy $file...\n";
}else{
echo " Copy Shod";
}
}
this code works fine but if my url has internal server error (500) it does not copy what i see on my brawser.,
i want this code to work even if the url has error 500.
can you please help me, or suggest me different command instead of copy.
thanks
this code copies any url ro txt
but it does not copy the errors , like sql errors ,
for example the url of http://www.yahoo.com works fine
but a url like http://www.webna.ir/category/?id=' which contains sql error
i need this sql error to be copied in to txt file.
I don't see the SQL error on that page (unless it's just not in English). PHP can only copy what is served to it via the server. If nothing is printed, nothing is copied.
superdezign wrote:I don't see the SQL error on that page (unless it's just not in English). PHP can only copy what is served to it via the server. If nothing is printed, nothing is copied.
no i need to copy these errors to txt file using this script.
this is the link correct one http://www.gpspassion.com/fr/news.asp?id='
i need to get these kind of errors.
but as you know the page Status is 500 (internal server error)
and it does not copy .
waiting for your kind advise superdezin
by using get contents it didnt work
Warning: file_get_contents(http://www.rahafestival.ir/shownews.asp?id=')
[function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in C:\www\a\1111.php on line 15