|
Author
|
Topic: Code Problem
|
soul Mann
Junior Member
Member # 3497
Rate Member
|
posted May 01, 2006 04:15 PM
Hello, The voiceXML document attached is one that take in the users inputs. It is hosted by voxbuilder. The program currently just asks for users username and password which works correctly. I want to submit these values to my php website. I then want the voiceXML document to speak out the user's name from the web page. This is what I am having problems with - I don't know how to access this information from the web page after data is sent. When I have attempted this I get errors that the document could not be fetched etc. Breakdown of structure of web page: The user login page contains variables: uname pass These variables are posted to dologin.php it posts-> uname pass to see if match in database if successful it goes to sucessfulLogin.php page which is where I want to voiceXML to say the user's name which is a variable on it. Once I can get my head around the basic principle of submitting data and the retrieving data I think I will be able to get cracking with the rest. Thanks for your time. code:
<?xml version="1.0"?>
<!DOCTYPE vxml PUBLIC '-//Voxpilot/DTD VoiceXML 2.0//EN' 'http://dtd.voxpilot.com/voice/2.0/voxpilot_voicexml-2.0.dtd'>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
<form id="intro" scope="dialog"> <!-- Output without interaction taken in --> <block> <prompt> Welcome to the N T U School of Informatics and Computing Lecturer Booking Service. </prompt> <goto next="#getDetails"/> </block> </form>
<form id="getDetails" scope="dialog"> <field name="uname"> <prompt> Please state your N T U user name. </prompt> <grammar src="http://accounts.voxpilot.com/[email protected]/projects/FinalYearProject/grammar/student.gsl#User"/>
</field> <field name="pword"> <prompt> Please state your N T U password. </prompt>
</field>
<filled> <submit next="http://www.mitla.net/index.html" namelist="uname pword"/> <prompt> data sent successfully </prompt> </filled>
</form> <form id="exit" scope="dialog"> <block> Thank you for using this system </block> <block> <disconnect/></block> </form>
</vxml> [CODE]
Posts: 1 | From: london | Registered: May 2006
| IP: Logged
|
|
sarang
Junior Member
Member # 3502
|
posted May 02, 2006 08:51 AM
i think u r trying wrong web service may be... as u hav 3 different links on ur web page for lecturer ,student and for admin so u shud hav menu in vxml form for each individual and accordingly u hav to call web service. e.g. for student http://www.mitla.net/students/DoLogin.php?user=password=
Posts: 1 | From: india | Registered: May 2006
| IP: Logged
|
|
mheadd
Member
Member # 3181
Member Rated:
|
posted May 05, 2006 03:51 PM
You can't submit to an HTML page. You need to submit to a page that will render valid VoiceXML.
The submit element will transition the caller to a new page, so the prompt and form you have after your submit element will not be heard by the caller.
In the "next" attribute of your submit element, you need to put the URL of the PHP script that can accept posted variables (those in your namelist attribute) For example:
code:
<submit next="dologin.php" namelist="uname pword"/>
<?php // dologin.php file to accept variables and render VoiceXML page $user_id = $_GET['uname']; $pwd = $_GET['pword']; ?> <?xml version = "1.0"?> <vxml version = "2.0"> <form id="example"> <block> <prompt> You submitted a user ID of <?php echo $user_id; ?>, and a password of <php echo $pwd; ?>. </prompt> <disconnect/> </block> </form> </vxml>
You may also want to have a look at this post for some more tips on using PHP in your VoiceXML scripts.
Hope this helps.
-------------------- Mark VoiceinGov.org http://www.voiceingov.org
Posts: 55 | Registered: Jun 2005
| IP: Logged
|
|
|