PDA

View Full Version : Post Variable in multiple forms



tanha2007
یک شنبه 16 تیر 1387, 15:12 عصر
Hi.
I have two forms with the following names and properties:
1. register.php --- ----- action="register-exec.php" --- method="POST"
2. register-exec.php --- action="register-exec.php" --- method="POST"


After submitting the register.php, I used session in register-exec.php to store the value of the register.php for later use as follow:


session_start();
$_SESSION['bookTitle'] = $_POST['txtBookTitle'];
$_SESSION['bookInfo'] = $_POST['txtBookInfo'];
Then after submitting the register-exec.php, I wanted to use those session variables, as follow:




if( isset($_POST['register-exec']) ){
echo $bookTitle;
echo $_SESSION['bookTitle'];
} if( isset($_POST['register-exec']) ){ echo $bookTitle; echo $_SESSION['bookTitle']; } None of them work?
what is wrong ???

musiox
یک شنبه 16 تیر 1387, 21:09 عصر
دلایل زیادی ممکنه داشته باشه اگه میشه کدتو کامل اینجا بزار.

tanha2007
دوشنبه 17 تیر 1387, 11:47 صبح
تشکر دوست عزیز.
بالآخره من از INPUT HIDDEN عنصر فرم استفاده نمودم و درست شد.