Hi folks,
I have a form that uses functions.
The form:
form.php
<?php
include headers
include “functions.php”;
if (action == “check”) {
validateForm($var1, $var2, ..varN); }
else {
showTheForm($var1, $var2, .. $varN); }
include footers
?>
The functions file:
functions.php
<?php
showTheForm($var1, $var2, .. $varN) {
$sql statement to pull in some fields for the form;
Execute statement;
// here’s where the trouble is???
Echo “<form action=form.php?uid=$uid method=post>”;
Echo” <input type=hidden name=action value=check>”;
... All the other fields ...
Echo “<Submit button code – image type>”;
}
validateForm($var1, $var2, .. $varN) {
do the validations for each field to make sure they are entered. If all is fine and dandy, spit out some links to take the user to the next stage;
}
?>
Note: uid = user id
The thing is, when the user arrives at the form page the first time, the uid variable is present. But after filling in the details and the form is submitted (it gets submitted back to form.php for validation) it looses the uid value. Everything else works fine … what am I doing wrong?
Any help would be appreciated.
Giovanni