I have a script that runs on all my pages. It needs to know what the previous page was if there was one. Is there a way to pass the the url via post without using a form? I don't want to pass it by attaching it to the url of all my links. Also, I don't want to write a javascript.
I have a login script that only sets variables after the page went through once. I get warnings that my index was not set ( $POST['INDEX'] ). Is it good code to initalize those indexes before hand.
for example: ( this is the form of my script )
( my regestration is about the same except it
has like 10 $POST variables at it gets ugly if
I do it like this )
if ( !isset( $POST('USER_NAME') ) {
$POST['USER_NAME'] = "";
}
if ( !isset( $POST('PASSW') ) {
$POST['PASSW'] = "";
}
$logged_in = 0;
if ( $POST['USER_NAME'] != "" && $POST['PASSW'] != "" ) {
//validate...
//login...
$logged_in = 1;
//echo out confermation
//echo out link to return to page before login
}
if ( !$logged_in ) {
// echo out login form
}