473,804 Members | 3,004 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Handling a multiple submit from VXML

1 New Member
Hi all,

I'm having some trouble getting my php code to work properly. I'm submitting three different variables from a vxml form to my php. I then need the php to deposit the variables into files and update a mysql database accordingly, but it's not quite doing what I want it to.

The code is run from a webserver via an AIX server.

Here's my php code that I got so far:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. header('Content-type: application:voicexml+xml; charset=iso-8859-1');
  4. header('Content-Encoding: iso-8859-1');
  5.  
  6. echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n";
  7. echo "<vxml version=\"2.1\" xmlns=\"http://www.w3.org/2001/vxml\" xml:lang=\"en-GB\">";
  8. echo "<property name=\"inputmodes\" value=\"dtmf\"/>";
  9. echo "<form>";
  10. echo "<block>";
  11.  
  12. $msg = "";
  13. $msg2 = "";
  14. $code = 1;
  15. $wavName = "";
  16. $wavAudition = "";
  17. $number = "";
  18.  
  19. $tmpFile=$HTTP_POST_FILES['rec_name']['tmp_name'];
  20.  
  21. if (is_uploaded_file($tmpFile)) {
  22.     $wavName="/name/".date("YmdHis").".wav";
  23.     copy($tmpFile, sprintf("%s", $wavName));
  24.     $msg = "audio saved";
  25.     echo "saved name";
  26.  
  27. } else {
  28.     $code = 0;
  29.     $msg = "unable to save audio";
  30.     echo "not saved";
  31. }
  32.  
  33. $tmpFile=$HTTP_POST_FILES['rec_audition']['tmp_name'];
  34.  
  35. if (is_uploaded_file($tmpFile)) {
  36.     $wavAudition = "audition/".date("YmdHis").".wav";
  37.     copy($tmpFile, sprintf("%s", $wavAudition));
  38.     $msg2 = "audio saved";
  39.     echo "saved audition";
  40.  
  41. } else {
  42.  
  43.     $code = 0;
  44.     $msg2 = "unable to save audio";
  45.     echo "not saved";
  46. }
  47.  
  48. $tmpFile = $HTTP_POST_FILES['contact_number']['tmp_name'];
  49.  
  50. if (is_uploaded_file($tmpFile)) {
  51.  
  52.     copy($tmpFile, sprintf("%s", $number);
  53.  
  54. }
  55.  
  56. $con = mysql_connect("localhost","username","password");
  57. if (!$con) {
  58.  
  59.   die('Could not connect: ' . mysql_error());
  60.  
  61. }
  62.  
  63. mysql_select_db("Database Name", $con);
  64.  
  65. $callDate = date("Ymd");
  66. $callTime = date("His");
  67.  
  68. $sql="INSERT INTO table (calContactDir, calContactNum, calAuditionDir, calDate, calTime)
  69. VALUES
  70. ('$wavName','$number','$wavAudition', '$callDate', '$callTime')";
  71.  
  72. if (!mysql_query($sql,$con)) {
  73.  
  74.   die('Error: ' . mysql_error());
  75.  
  76. }
  77.  
  78. $sql="SELECT calUniqueID FROM Caller WHERE calContactDir = '$wavName'";
  79.  
  80. $uniqueID = mysql_query($sql,$con);
  81.  
  82. mysql_close($con);
  83.  
  84. echo "<audio src=\"file:///170.wav\" maxage=\"0\"/>";
  85. echo "<prompt>$callDate</prompt>";
  86. echo "<audio src=\"file:///171.wav\" maxage=\"0\"/>";
  87. echo "<prompt>$uniqueID</prompt>";
  88. echo "<goto next=\"file:///Audition_test.vxml#closing\"/>";
  89.  
  90. echo "</block>";
  91. echo "</form>";
  92. echo "</vxml>";
  93.  
  94. ?>
  95.  
The files are submitted with the following line of code:

Expand|Select|Wrap|Line Numbers
  1. <submit next="submit.php" namelist="rec_name contact_number rec_audition" method="POST" enctype="multipart/form-data"/>
  2.  
The problem is that it isn't depositing the variables into files and it's only inserting values into the time and date sections of the mysql database.

The parts of the code that are in italics are sections that I have removed as I'm under a Non Disclosure Agreement concerning the application and I don't want to place our database details, etc. out in the open (hope no one minds).

If anyone could help me out that would be greatly appreciated.
Jul 2 '07 #1
0 1441

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1581
by: Richard Kasperowski | last post by:
Boston Mobile is the Boston-area mobile software developers group. We are a community of people who build applications for mobile devices such as mobile phones, PDAs, and pocket PCs. We meet approximately once a month to share our experiences developing mobile applications, and we discuss mobile development issues on our email list. More information is at "http://bostonmobile.org/". Next meeting Topic: Voice Enabling enterprise...
3
2152
by: Tina | last post by:
I have an aspx page with a textbox and an "add to my Account Button." when the button is pushed, my program adds the amount in the textbox to the database which, lets say takes a few seconds. If the user rapidly clicks on the "add to my Account Button" it generates multiple postbacks, which I believe all get processed asyncronously. I don't want for it to work this way. I don't want the user to be able to issue another postback until...
0
1336
by: stanna | last post by:
Hello, We are looking for XML/Soap/VxML experts to work in US as well as in India, If anybody is looking for job, send your resume to stanna at optonline dot net. Salaries are attractive. Sai, stanna@optonline.net.
0
1055
by: polar086 | last post by:
Hi, For anyone that is familiar with vxml. Is there any way to recognize only part of a sentence, and disregard the rest? For example, I want to recognize "I grew up in *anything*", where *anything* is absolutely any utterance the user gives. Setting the grammar to just recognize "I grew up in" doesnt do the trick. What is really need is a way to dynamically set confidence threshholds for individual components of a grammar, but Im not...
5
14134
by: c676228 | last post by:
Hi everyone, my colleagues are thinking about have three insurance plans on one asp page: I simplify the plan as follow: text box:number of people plan1 plan2 plan3
6
4411
jenkinsloveschicken
by: jenkinsloveschicken | last post by:
I am developing a administrative backend for our sales dept website. They are using admin forms to manipulate what is displayed for the end user on the site. I am running into a problem with a form design. The admin user needs to be able to assign both an image and a corresponding PowerPoint/Word/etc document to be downloaded once the end-user selects it. I am able to get the image in and out of the database no problem, but I am not able to...
8
1789
by: JWest46088 | last post by:
I'm having problems with my error handling. It's kind of hard to explain so I'll just post my code and bold where the error handling is and then explain what is happening. Just to warn you, I am new to Perl so the code probably will be ugly! #! /usr/local/bin/perl BEGIN { open(STDERR, ">&STDOUT");
0
3628
by: dhyder | last post by:
I'm working on an admin page for a SQL Server 05 db. The page is in ASP.NET 2.0/C#. The db has multiple tables with foreign keys/constraints. I have multiple SqlDataSources and GridViews, which are doing the select/update/delete methods. I manually did the Insert method for each Gridview and I am able perform error handling on it. Textboxes for data to add <asp:Button ID="btnInsertNewService runat="server" Text="Submit"...
6
7576
by: phpnewbie26 | last post by:
My current form has one multiple select drop down menu as well as few other drop down menus that are single select. Originally I had it so that the multiple select menu was first, but this created the problem that when I went to select the other drop down menus, the selections i made on the multiple select one would clear. Then I had tried putting the multiple select menu last so that the selections wouldn't clear but then after clicking the...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9577
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10075
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.