basically im using a form which uses ajax script to process the form and send it to sendmail.php on my form a have a hidden field called token which is generated by using this :
<?
$token = md5(uniqid(rand(), true));
$_SESSION['token'] = $token;
print "Your session ID is:" . $_SESSION['token']; //displays the token
?>
which displays fine, and on sendmail i have
echo $_SESSION['token']; //displays the token
which displays nothing. is there a reason the session isnt getting passed?
the javascript that sends the form data :
// Turn off the alert pop up
wf.showAlertOnError = false;
// Tap into the validation routine and do our Ajax stuff
wf.functionName_formValidation = "myCustomValidation";
function myCustomValidation (evt) {
if(wf.formValidation(evt)) new Ajax.Updater('result', 'forms/sendmail.php',{onLoading:function(request){sendmail()},onComplete:function(request){handelrequest()},parameters:Form.serialize(document.forms['contact']), insertion:Insertion.Bottom, asynchronous:true});
return wf.utilities.XBrowserPreventEventDefault(evt);
}
function sendmail() {
//Make the Progress Bar Appear
new Effect.Appear('progress');
}
function handelrequest() {
// Fade the Progress Bar
new Effect.Fade('progress');
// Make the form itsef wipe up
new Effect.BlindUp('form');
// Show the result!
new Effect.Appear('result');
}