Submitting VXML data into MySQL db
Posted: Wed Jul 23, 2008 2:07 pm
Collecting an end user's phone number is successful.
However, when the following submit is executed -- <submit method="post" namelist="p_phone" next="AddToDB/enter_data.php"/>
I get a "bad.fetch" announcement when calling on the phone.
And the error log shows 2 errors [error no_ani 7 [23/Jul/2008:14:29:38 -0400] 5734 000000;007;1216837223 DocumentParser::FetchDocument - Parse error in file "AddToDB/enter_data.php", line 1, column 1 - Invalid document structure]
[error no_ani 7 [23/Jul/2008:14:29:38 -0400] 5734 000000;007;1216837223 errno: 205 uri AddToDB/enter_VXML_data.php]
What does that tell you?
Invalid document structure?
But the same php document (enter_data.php) is used in another application where it is called on by a PHP document not a VXML document -- and it does indeed work properly -- inserting data everytime into the MySQL db. Without fail.
So, unless I'm wrong, the (enter_data.php) code must be written differently when submitting from VXML than it is when submitting from a PHP document.
If that is the case, what should the code be in the (enter_data.php) document?
enter_data.php
I've also tried the following code, renaming the file to
(enter_VXML_data.php) and reworking the VXML submit to the following:
(<submit method="post" namelist="p_phone" next=AddToDB/enter_VXML_data.php"/>
Again the phone gives me a Bad.Fetch error and the error log presents:
[error no_ani 26 [23/Jul/2008:13:38:11 -0400] 5734 000001;026;1216833916 DocumentParser::FetchDocument - Parse error in file "AddToDB/enter_VXML_data.php", line 1, column 4 - Unknown element 'br']
[error no_ani 26 [23/Jul/2008:13:38:11 -0400] 5734 000001;026;1216833916 errno: 205 uri AddToDB/enter_VXML_data.php]
Wait! Line 1 is just <?PHP, there is no column 4, or any column for that matter, and there is no 'br' in the entire (enter_VXML_data.php) document.
enter_VXML_data.php
Oh just in case you are wondering the columns in the MySQL db are p_phone, ,p_email,p_sex,p_first_name,p_last_name.
I hope you can show me a solution because although the Plum Tutorial demonstrates how to insert a voice recording into a document for saving it does not address these issues.
Thank you,
However, when the following submit is executed -- <submit method="post" namelist="p_phone" next="AddToDB/enter_data.php"/>
I get a "bad.fetch" announcement when calling on the phone.
And the error log shows 2 errors [error no_ani 7 [23/Jul/2008:14:29:38 -0400] 5734 000000;007;1216837223 DocumentParser::FetchDocument - Parse error in file "AddToDB/enter_data.php", line 1, column 1 - Invalid document structure]
[error no_ani 7 [23/Jul/2008:14:29:38 -0400] 5734 000000;007;1216837223 errno: 205 uri AddToDB/enter_VXML_data.php]
What does that tell you?
Invalid document structure?
But the same php document (enter_data.php) is used in another application where it is called on by a PHP document not a VXML document -- and it does indeed work properly -- inserting data everytime into the MySQL db. Without fail.
So, unless I'm wrong, the (enter_data.php) code must be written differently when submitting from VXML than it is when submitting from a PHP document.
If that is the case, what should the code be in the (enter_data.php) document?
enter_data.php
Code: Select all
<?php
$dbhost='HHHHHHHHHHHHHH';
$dbusername='UUUUUU';
$dbuserpass='PPPPPPPPPPP';
$dbname='NNNNNNNN';
$link_id = mysql_connect ($dbhost, $dbusername, $dbuserpass);
if (!mysql_select_db($dbname)) die(mysql_error());
$query="INSERT INTO web_enrollment (p_phone,p_email,p_sex,p_first_name,p_last_name)
VALUES ('$_POST[p_phone]','$_POST[p_email]','$_POST[p_sex]','$_POST[p_first_name]','$_POST[p_last_name]')";
if(!mysql_db_query($dbname,$query,$link_id)) die(mysql_error());
?>
(enter_VXML_data.php) and reworking the VXML submit to the following:
(<submit method="post" namelist="p_phone" next=AddToDB/enter_VXML_data.php"/>
Again the phone gives me a Bad.Fetch error and the error log presents:
[error no_ani 26 [23/Jul/2008:13:38:11 -0400] 5734 000001;026;1216833916 DocumentParser::FetchDocument - Parse error in file "AddToDB/enter_VXML_data.php", line 1, column 4 - Unknown element 'br']
[error no_ani 26 [23/Jul/2008:13:38:11 -0400] 5734 000001;026;1216833916 errno: 205 uri AddToDB/enter_VXML_data.php]
Wait! Line 1 is just <?PHP, there is no column 4, or any column for that matter, and there is no 'br' in the entire (enter_VXML_data.php) document.
enter_VXML_data.php
Code: Select all
<?php
$dbhost='HHHHHHHHHHHHHH';
$dbusername='UUUUUU';
$dbuserpass='PPPPPPPPPPP';
$dbname='NNNNNNNN';
$link_id = mysql_connect ($dbhost, $dbusername, $dbuserpass);
if (!mysql_select_db($dbname)) die(mysql_error());
$query="INSERT INTO web_enrollment (p_phone) VALUES (namelist="p_phone")";
if(!mysql_db_query($dbname,$query,$link_id)) die(mysql_error());
?>
I hope you can show me a solution because although the Plum Tutorial demonstrates how to insert a voice recording into a document for saving it does not address these issues.
Thank you,