Re: passing mysql_error() out put to a different page?
| From: | Marek Kilimajer | Date: | Wed, 16 Oct 2002 09:40:47 +0000 |
| Subject: | Re: passing mysql_error() out put to a different page? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-120152@lists.php.net to get a copy of this message | ||
And also on the folloving page use echo htmlspecialchars(stripslashes($_GET['err_value']));
John W. Holmes wrote:
Well, the die() function takes a limited number of parameters, whichasyou noted is why it doesn't like the assignment of the mysql_error() andtheheader statements both inside the die() function. So, why not something like this: $res = mysql_query(.....); if ($res == FALSE) //which is what I _believe_ die() looks at /* or at least this is what the manual says the function returns on a query error */ { $error = mysql_error(); Header("Location: logerror.php?op=insert_error&err_value=$error");If you do it this way, you'll want to urlencode(), rawurlencode(), or base64_encode() the $error. You only have to decode on the receiving end if you use the base64_encode. ---John Holmes...