Page 1 of 1

submit recording and variable to another file

Posted: Tue Dec 09, 2014 2:03 pm
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.

Re: submit recording and variable to another file

Posted: Tue Dec 09, 2014 4:50 pm
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

Re: submit recording and variable to another file

Posted: Tue Dec 09, 2014 5:13 pm
by 2020connection
Thanks,

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