Maybe you should just save the error message into a cookie or session and then use header() to redirect to the error page.
---John Holmes... > -----Original Message----- > From: Peter Houchin [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 14, 2002 9:22 PM > To: Brad Bonkoski > Cc: php_gen > Subject: RE: [PHP] passing mysql_error() out put to a different page? > > i have tried this .. but am getting errors at the moment .. (the sql error > is deliberate) > > function new_user() { > > $res = mysql_query("INSERT INTO users WHERE uname='$_POST[uname]' , > passwd='$_POST[pass]', firstname='$_POST[firstname]', > lastname='$_POST[lastname]', email='$_POST[email]' ") > > // pass error onto logerror page > > or die ('<form> <input type=hidden name=mysqlerror value=\"<?php echo > mysql_error();?>\"></form>' Header("Location: > logerror.php?op=insert_error")); > > // insert into db worked redirect > Header("Location: index.php"); > } > > but so far it's not likeing the Header inside the die that's fair enough I > can figure out why.. but other wise i can't figure out how to pass the die > value through if i make the error redirect out side the die and have it > in > a if statement or the like... > > > -----Original Message----- > > From: Brad Bonkoski [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, 15 October 2002 11:07 AM > > To: Peter Houchin > > Cc: php_gen > > Subject: Re: [PHP] passing mysql_error() out put to a different page? > > > > > > Very interesting question.... > > > > The only thing I can come up with right now is if you detect an error > > (one of the functions returning FALSE,) > > you can write the contents of mysql_error() to a file log and display > that > > file on another page? Or pass the output of that (mysql_error()) as an > > HTTP/form variable to another page? > > ...spark any additional ideas?? > > -Brad > > > > Peter Houchin wrote: > > > > > howdy, > > > > > > I have a page that I want to control the errors etc for a site, > > now what I > > > want is to perform a query on one page but if there's an error > > it opens a > > > different page with the error message on it including the out put from > > > mysql_error() can this be done? > > > > > > Cheers > > > > > > Peter > > > "the only dumb question is the one that wasn't asked" > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php