Hi all,
I came across this problem where i have to submit three variables from VoiceXML to PHP.
It seems like php doesn't allow it.
Could someone please tell me if it is posible to do so, and if so, how do i do it ?[/syntax]
Submit multiple values to PHP
Moderator: General Moderators
Re: Submit multiple values to PHP
please elaborate.cipher#1 wrote:I came across this problem where i have to submit three variables from VoiceXML to PHP.
Well, The voice app gets a callers name, contact number, and has a chance to leave a message.
After that is done, the three variables need to be sent to php so that php can store them in a mySQL database.
The name is recorded over the fone, the contact number is being keyed in from the telephone keypad, and the message is also being recorded.
So what i want to do is submit the three variables to php and then store them in a database.
After that is done, the three variables need to be sent to php so that php can store them in a mySQL database.
The name is recorded over the fone, the contact number is being keyed in from the telephone keypad, and the message is also being recorded.
So what i want to do is submit the three variables to php and then store them in a database.
The data is probably sent via http-get or http-post. php stores those parameters in the arrays $_GET and $_POST.
e.g.
e.g.
would send a parameter maincourse via http-post. In the receiving php script you could access this parameters as $_POST['maincourse'].http://www.w3.org/TR/voicexml/ wrote:Code: Select all
<form> <field name="maincourse"> <prompt> Please select an entree. Today, we’re featuring <enumerate/> </prompt> <option dtmf="1" value="fish"> swordfish </option> <option dtmf="2" value="beef"> roast beef </option> <option dtmf="3" value="chicken"> frog legs </option> <filled> <submit next="/cgi-bin/maincourse.cgi" method="post" namelist="maincourse"/> </filled> </field> </form>
OK thanx.
But i need to store the three variables seperatly in the database, each variable in its own database field.
If im understanding your code right, it only sends over one variable.
In my VXML code i post the variables as:
But i need to store the three variables seperatly in the database, each variable in its own database field.
If im understanding your code right, it only sends over one variable.
In my VXML code i post the variables as:
- <submit src="http://www.########.co.za/####/submit.php" enctype="multipart/form-data" namelist="rec_name contact_number rec_message" method="post" maxage="0" />
one field, one post parameter.<field name="maincourse">
If there were more fields, e.g.
Code: Select all
<field name="maincourse">...
<field name="foo">...
<field name="bar">...