Hi All
I have wrttend code to validate the inputs in PHP file, ones call is validated, I have to redirect back to plum scratch pad, but call is getting hanged in PHP file.
The below is the code written by me... Please help me
<form id="clockin">
<field name="customerid" type="digits?length=4">
<prompt>
You have selected for Clock In.
</prompt>
<prompt>
Enter Client ID and press Hash to Submit.
</prompt>
<filled>
You entered <value expr="customerid"/>.
<prompt>
Please wait while we process your information.
</prompt>
<submit namelist="customerid" next="http://voicexcall.99k.org/TestVXML/CustomerID.php"/>
<goto next="#caretaker"/>
</filled>
<noinput>
Sorry, No Input received.
<reprompt/>
</noinput>
<nomatch>
Sorry, Invalid Client ID.
<reprompt/>
</nomatch>
</field>
<block>
Please hold for clockin.
</block>
</form>
<form id="caretaker">
<field name="caretakerid" type="digits?length=6">
<prompt>
Enter CareTaker ID and Password. Enter CareTakerID followed by Star then Password. And press Hash to Submit.
</prompt>
<filled>
You entered <value expr="caretakerid"/>.
<prompt>
Please wait while we process your information.
</prompt>
<submit namelist="caretakerid" next="http://voicexcall.99k.org/TestVXML/CareTakerID.php"/>
</filled>
<noinput>
Sorry, No Input received.
<reprompt/>
</noinput>
<nomatch>
Sorry, Invalid CareTaker ID.
<reprompt/>
</nomatch>
</field>
<block>
Please hold for clockin.
</block>
</form>
--------- PHP code----------------
<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
$customerid = $_GET[customerid];
?>
<vxml version="2.0">
<form>
<block>
<prompt>
Your Customer ID is <?php echo($customerid)?>.
</prompt>
</block>
</form>
</vxml>
We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics
Redirect back to Plum from PHP file, not working
-
- Posts: 19
- Joined: Mon Jun 21, 2010 4:00 am
Re: Redirect back to Plum from PHP file, not working
Hi,
In the case where you want to submit some data to another page, execute that other page, and then return to the parent document at the same point where you left off, you actually want to use the <subdialog> tag. If you are trying to use the subdialog (which in this case, is the PHP page) to validate a customerid, you might want to send some data back to the parent document that contains whether or not the customerid was valid. Then, you could do some branching based on the validity of the customerid. The following is an example using your code of how you would do this using a subdialog.
clockin.php
CustomerID.php
In clockin.php, the line...
...will clear out your variables, and effectively restart your application from the beginning.
Regards,
Plum Support
In the case where you want to submit some data to another page, execute that other page, and then return to the parent document at the same point where you left off, you actually want to use the <subdialog> tag. If you are trying to use the subdialog (which in this case, is the PHP page) to validate a customerid, you might want to send some data back to the parent document that contains whether or not the customerid was valid. Then, you could do some branching based on the validity of the customerid. The following is an example using your code of how you would do this using a subdialog.
clockin.php
Code: Select all
<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">
<form id="clockin">
<field name="customerid" type="digits?length=4">
<prompt>
You have selected for Clock In.
Enter Client ID and press Hash to Submit.
</prompt>
<filled>
<prompt>
You entered <value expr="customerid"/>.
Please wait while we process your information.
</prompt>
</filled>
<noinput>
Sorry, No Input received.
<reprompt/>
</noinput>
<nomatch>
Sorry, Invalid Client ID.
<reprompt/>
</nomatch>
</field>
<subdialog name="sendid" namelist="customerid" src="CustomerID.php">
<filled>
<if cond="sendid.confirmation=='verified'">
<prompt>
Your customer ID was verified.
</prompt>
<goto next="#caretaker"/>
<else/>
<prompt>
Your customer ID was not verified.
</prompt>
<clear namelist="sendid customerid clockin"/>
</if>
</filled>
</subdialog>
</form>
<form id="caretaker">
<field name="caretakerid" type="digits?length=6">
<prompt>
Enter CareTaker ID and Password. Enter CareTakerID followed by Star then Password. And press Hash to Submit.
</prompt>
<filled>
You entered <value expr="caretakerid"/>.
<prompt>
Please wait while we process your information.
</prompt>
<submit namelist="caretakerid" next="http://voicexcall.99k.org/TestVXML/CareTakerID.php"/>
</filled>
<noinput>
Sorry, No Input received.
<reprompt/>
</noinput>
<nomatch>
Sorry, Invalid CareTaker ID.
<reprompt/>
</nomatch>
</field>
<block>
Please hold for clockin.
</block>
</form>
</vxml>
Code: Select all
<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
$customerid = $_GET[customerid];
$confirmation = "verified";
?>
<vxml version="2.0">
<form>
<block>
<var name="confirmation" expr="'<?php echo($confirmation)?>'"/>
<prompt>
Your Customer ID is <?php echo($customerid)?>.
</prompt>
<return namelist="confirmation"/>
</block>
</form>
</vxml>
Code: Select all
<clear namelist="sendid customerid clockin"/>
Regards,
Plum Support
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com