We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

submit recording and variable to another file

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
2020connection
Posts: 6
Joined: Tue Dec 09, 2014 1:55 pm

submit recording and variable to another file

Post by 2020connection »

Hello,

I'm trying to submit value of a variable into file2.php from file1.php. But it change the variable value i.e. value is '18046212020' and it's posting '18046212069.000000'

Below is the vxml code im using

<submit method="post" enctype="multipart/form-data" next="http://example.com/file2.php" namelist="rec callerid"/>

'18046212020' is the customer number and i'm trying to save recording by customer number.
Last edited by 2020connection on Tue Dec 09, 2014 5:14 pm, edited 1 time in total.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: submit recording and variable to another file

Post by support »

Hi Riz,

Would you be able to provide a sample of your code that demonstrates this issue? The following code example demonstrates how you can use the <submit> tag to submit a value from file1.php to file2.php.

Please note from the example that you would need to include single quotes around the value for the variable.

file1.php:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">

<form>
<var name="callerid" expr="'18046212020'"/>

  <field name="customerid" type="digits">
      <prompt>
        Please enter your customer identification number using your keypad.
      </prompt>
  </field>

  <field name="age" type="digits?minlength=1;maxlength=2">
      <prompt>
        Please enter your age using your keypad.
      </prompt>
  </field>

  <block>
    <prompt>
      Please wait while we process your information.
    </prompt>
    <submit next="http://servername.com/file2.php" method="post" namelist="customerid age callerid"/>
  </block>
</form>

</vxml>
file2.php:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");

$customerid = $_POST[customerid];
$age = $_POST[age];
$callerid = $_POST[callerid];
?>

<vxml version="2.0">
  <form>
    <block>
      <prompt>
        Your customer identification number is <?php echo($customerid)?>.
      </prompt>
      <prompt>
        Your age is <?php echo($age)?>.
      </prompt>
      <prompt>
        Your caller identification is <?php echo($callerid)?>.
      </prompt>
    </block>
  </form>
</vxml>
Hope this example helps.

Regards,
Plum Support

2020connection
Posts: 6
Joined: Tue Dec 09, 2014 1:55 pm

Re: submit recording and variable to another file

Post by 2020connection »

Thanks,

It has been resolved, I was using <var name="callerid" expr="18046212020"/> instead of <var name="callerid" expr="'18046212020'"/>

Post Reply