Page 1 of 1

Good code gone bad!

Posted: Tue Aug 26, 2008 11:39 am
by Rov
This code worked yesterday.
Today it generates an error.
What could possibly be wrong with it?
Validation failed: no DTD found !Unescaped '<' not allowed in attributes values in Entity, line: 30

30 <var name="caller_name" expr=" '<? echo ($Caller_row[0]) ?>' " />


Pet_ROOT.php

Code: Select all

<?php

$dbhost='dbh';
$dbusername='dbun';
$dbuserpass='dbpwd';
$dbname='dbn';
$dbTable='dbt';

$conn = mysql_connect($dbhost, $dbusername, $dbuserpass) or die('Error connecting to mysql'.mysql_error());
mysql_select_db($dbname);

   $Caller_query="SELECT caller_name FROM dbt WHERE  type='".100."' ";
   $Caller_result=mysql_query($Caller_query)or die(mysql_error());
   $Caller_row=mysql_fetch_array($Caller_result)or die(mysql_error());

   $Owner_query="SELECT owner_name FROM dbt WHERE  type='".100."' ";
   $Owner_result=mysql_query($Owner_query)or die(mysql_error());
   $Owner_row=mysql_fetch_array($Owner_result)or die(mysql_error());

   $Pet_query="SELECT pet_name FROM dbt WHERE  type='".100."' ";
   $Pet_result=mysql_query($Pet_query)or die(mysql_error());
   $Pet_row=mysql_fetch_array($Pet_result)or die(mysql_error());

mysql_close($conn);
?>
<vxml version="2.0">
<form id="SetGlobalVariables">
<block>

<var name="caller_name" expr=" '<? echo ($Caller_row[0]) ?>' " />
<assign name="application.CallerName" expr="program_name"/>

<var name="owner_name" expr=" '<? echo ($Owner_row[0]) ?>' " />
<assign name="application.OwnerName" expr="owner_name"/>

<var name="pet_name" expr=" '<? echo ($Pet_row[0]) ?>' " />
<assign name="application.PetName" expr="pet_name"/>

<goto next="Intro.vxml"/>
</block>
</form>
</vxml>

IVR problem fixed by adding lines to code

Posted: Tue Aug 26, 2008 1:25 pm
by support
Hi Rov,

Looking through your IVR code, we noticed that you are missing these lines:

Code: Select all

header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
within your php code. You should add these lines in your IVR code to try to debug this IVR error.

Regards,
Plum Support

Posted: Tue Aug 26, 2008 2:46 pm
by Rov
Okay, I inserted the lines you suggested.
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
But now I'm getting a different error.
Start tag expected, '<' not found in Entity, line: 26
26 echo("<?xml version=\"1.0\"?>\n");


Did I put your code in the wrong place?

Code: Select all

<?php

$dbhost='dbh';
$dbusername='dbun';
$dbuserpass='dbpwd';
$dbname='dbn';
$dbTable='dbt';

$conn = mysql_connect($dbhost, $dbusername, $dbuserpass) or die('Error connecting to mysql'.mysql_error());
mysql_select_db($dbname);

   $Caller_query="SELECT caller_name FROM dbt WHERE  type='".100."' ";
   $Caller_result=mysql_query($Caller_query)or die(mysql_error());
   $Caller_row=mysql_fetch_array($Caller_result)or die(mysql_error());

   $Owner_query="SELECT owner_name FROM dbt WHERE  type='".100."' ";
   $Owner_result=mysql_query($Owner_query)or die(mysql_error());
   $Owner_row=mysql_fetch_array($Owner_result)or die(mysql_error());

   $Pet_query="SELECT pet_name FROM dbt WHERE  type='".100."' ";
   $Pet_result=mysql_query($Pet_query)or die(mysql_error());
   $Pet_row=mysql_fetch_array($Pet_result)or die(mysql_error());

mysql_close($conn);
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n"); 
?>
<vxml version="2.0">
<form id="SetGlobalVariables">
<block>

<var name="caller_name" expr=" '<? echo ($Caller_row[0]) ?>' " />
<assign name="application.CallerName" expr="program_name"/>

<var name="owner_name" expr=" '<? echo ($Owner_row[0]) ?>' " />
<assign name="application.OwnerName" expr="owner_name"/>

<var name="pet_name" expr=" '<? echo ($Pet_row[0]) ?>' " />
<assign name="application.PetName" expr="pet_name"/>

<goto next="Intro.vxml"/>
</block>
</form>
</vxml>

Check call logs to help debug IVR issue

Posted: Tue Aug 26, 2008 3:03 pm
by support
Hi,

Have you tried checking your IVR call logs for the last VXML file? This would you in debugging this IVR issue.

Regards,
Plum Support