Hello
I am writing a page to show frequently asked questions as well giving the option to submit a question. I am using sessions to pass the information from one page to another, but the variable values do not seem to be being passed. i have used this code to start session and set variables:
<?php
session_start();
session_register('name','enquiry','subject','nrows');
setcookie("phpsessid",session_id(),time()+3600);
?>
<form action="faqthanks.php" method="post">
Name<input type="text" name=<?php echo $name ?> size="20">
Subject<input type="text" name=<?php echo $subject ?> size="20">
Question<textarea rows="5" name=<?php echo $enquiry ?> cols="40"></textarea>
<?php
$nrows = mysql_num_rows($quest)+1;
?>
<input type="hidden" name="faqnumber" value="<?php echo $nrows ?>";
</form>
The $nrows variables sets the id number that then goes into a database. Cookies have been enabled on my browser so the session id must be being passed.
This is the code that collect varables:
<?php
session_start();
?>
<?php
echo "Thank you for your enquiry ";
echo $name;
mail("email@myemail.com","Submitted question",$enquiry);
?>
Neither the $name or the $enquiry variables register any value as set on previous page. I originally thought this might be problem with the session storage on the server, but tests on other servers give the same result. Any help would be greatly appreciated as i think I am just being a pillock and have missed something blatent. Thanks a lot.
Tom