Forum Moderators: coopster
The dynamic pages get called on $_POST and $_GET actions
Is there a way that I can say capture was the scenario was and email me the details? So for example:
page: filename
$_POST vars listed here if any
$_GET vars listed here if any
Thanks!
So, assuming line 424 in your code looks like this:
$a = $var[0];
You can change it to this:
$a = @$var[0];
And then you can check if $a really contains a value... if it doesn't - you know an error occurred.
For example:
if (!isset($a))
{
//Send the relevant information to yourself via e-mail.
...
}
You can also use error_get_last:
[php.net...]
As for e-mailing the data to yourself - check out PHP's mail function:
[php.net...]
Basically say I get an error, any error, I'd like it to mail me the error.
I know the mail function no problem at all. But how do I check if there is an error? Say I run the page and the code goes but there is an error in there, any error...
How do I check if there is an error?
if(isset($error))
{
message = '';
if(!empty$_POST))
{
foreach($_POST as $p)
{
$message .=$p."<br>";
}
}
if(!empty$_GET))
{
foreach($_GET as $g)
{
$message .=$g."<br>";
}
}
mail($recipient, $message, $headers,etc...);
}