Jump to content

multiple parameters in postbody


hasjem

Recommended Posts

I have the following script:

 

<script type="text/javascript" src="prototype.js"></script>

<script>

 

new Ajax.Request("test.php",

{

method: 'post',

postBody: 'naam='+ $F('naam')+'&name='+$F('name'),

onComplete: showResponse

});

}

 

function showResponse(req){

$('show').innerHTML= req.responseText;

}

</script>

<form id="test" onsubmit="return false;">

<input type="hidden" name="name" id="name" value="<?echo$volgnummer;?>">

<input type="hidden" name="naam"  id="naam" value="<?echo$naam;?>">

<input type='hidden'name='wachtwoord' id="wachtwoord" value="<?echo$wachtwoord;?>">

<input type="submit" value="bieden" onClick="sendRequest()">

</form>

 

<div id="show"></div>

 

and for checking the following phpfile

 

<?php

 

 

echo "you typed ".$_POST["naam"];

 

echo "you typed ".$_POST["name"];

 

?>

 

now the problem is this part:

 

postBody: 'naam='+ $F('naam')+'&name='+$F('name'),

 

it only sends the first parameter,  "naam" and not the second.

 

what should the postbody look like to show more then one parameter?

 

thanx

 

lex moen

 

Link to comment
https://forums.phpfreaks.com/topic/201505-multiple-parameters-in-postbody/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.