HELP! No params passed from jscript to PHP script

HELP! No params passed from jscript to PHP script

am 27.01.2006 10:29:36 von Sean.Dewis

Hi

I've got a simple web form, with j script validation.

All i want it to do, once the form fields pass validation, is POST the
data to my PHP script for processing.

In a very simple html form without any j script validation, it works
fine.

Now I've messed with it, the PHP script doesn't get any data in it's
$_REQUEST variables.

Can someone please help me?

-----test.shtml-----









bgcolor="#e1e1e1">






Send a message






action="testsend.php" onsubmit="document.details.submit()">

























Enter your name:

Your e-mail
address:
(this will be used to provide you with
a
copy of the message)

maxlength="30"> maxlength="40" value="y...@emailaddress.com">
Your
phone number:

name="custTel">




Your comments or
additional details for your contact:
















Your IP address (logged
for security purposes)







style="WIDTH: 104px; HEIGHT: 22px">















--------------testsend.php-------------


$reqID = '2'; // $_REQUEST['cID'] ; This is meant to be set at 2 for
testing
$callback = $_REQUEST['callback'] ;
$custName = $_REQUEST['custName'] ;
$custTel = $_REQUEST['custTel'] ;
$serverIP = $_SERVER['REMOTE_ADDR'] ;

printf("cID from FORM POST = $reqID


");
printf("Your IP address: $serverIP
") ;
printf("callback(comments)=$callback
");
printf("custName=$custName
");
printf("custTel=$custTel
");

?>

Re: HELP! No params passed from jscript to PHP script

am 28.01.2006 10:10:59 von Simon

hi Sean, i just changed slightly in ur form tag

onSubmit="return submitForms();">

instead of

action="testsend.php" onsubmit="document.details.submit()">


onSubmit = "return submitForms();".. this is to call the function u
made for validation. and it worked fine when i tested. The errors i got
was because of the unusual line breaks this page placed and when i
copied it to my script editor. i just removed the line breaks and then
it worked fine...

the data which i entered in the form is displayed in testsend.php.

And yes ur this function had missing bracket which generates error

function submitForms()
{
if ( (isName() ) && (isEmail()) && (isPhone()) && (isComment()) &&
(isFavorite()) )
{
if (confirm("\nYou're about to send your contact this
message.\n\nClick on YES to send.\n\nClick on NO to abort."))
{
alert("\nYour message will now be sent.\n\n\nThank you!");
return true;
}
else
{
alert("\nYou have chosen not to send the message.");
return false;
}
}
else
return false;
}

I hope it would work in ur corner too.

good luck

regards,
Simon

Re: HELP! No params passed from jscript to PHP script

am 30.01.2006 10:12:51 von Sean.Dewis

Wow. it works a treat now. Thanks Simon. Sean

Re: HELP! No params passed from jscript to PHP script

am 30.01.2006 18:10:48 von Simon

U r most welcome. Cheers. lol