Question : error when calling php/xml file in browser

Hi,
     I'm going through the following tutorial
http://code.google.com/apis/maps/articles/phpsqlflex.html#outputxml

I've created the php file in the snippet below and checked that my webserver supports PHP dom_xml functionality.

However when i call the file from a browser i get the following error;

Fatal error: Call to undefined function domxml_new_doc() in /home/b51272/public_html/v3/phpsqlajax_genxml.php on line 6

any ideas? thanks
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
<?php
require("dbinfo.php");


// Start XML file, create parent node
$doc = domxml_new_doc("1.0");
$node = $doc->create_element("markers");
$parnode = $doc->append_child($node);

// Opens a connection to a MySQL server

$connection=mysql_connect (localhost, $user, $pass);
if (!$connection) {
  die('Not connected : ' . mysql_error());

}

// Set the active MySQL database
$db_selected = mysql_select_db($database, $connection);
if (!$db_selected) {
  die ('Can\'t use db : ' . mysql_error());
}

// Select all the rows in the markers table
$query = "SELECT * FROM markers WHERE 1";
$result = mysql_query($query);
if (!$result) {
  die('Invalid query: ' . mysql_error());
}

header("Content-type: text/xml");

// Iterate through the rows, adding XML nodes for each
while ($row = @mysql_fetch_assoc($result)){
  // ADD TO XML DOCUMENT NODE
  $node = $doc->create_element("marker");
  $newnode = $parnode->append_child($node);

  $newnode->set_attribute("mobNumber", $row['mobNumber']);
  $newnode->set_attribute("user_type", $row['user_type']);
  $newnode->set_attribute("lat", $row['lat']);
  $newnode->set_attribute("lng", $row['lng']);
  $newnode->set_attribute("status", $row['status']);
  $newnode->set_attribute("LatestUpdate", $row['LatestUpdate']);
  
}

$xmlfile = $doc->dump_mem();
echo $xmlfile;

?>

Answer : error when calling php/xml file in browser

I think you should add an external redirection web site rule to the site document for mail.mydomain.com, with as follows:
incoming url pattern: *
Redirect to this URL: https://www.otherdomain.com/Folder/file

Starting the redirect URL with a protocol specifier makes it an external redirect which send back the new URL to the browser (as described in the Administrator Help).

If you had read the Administrator Help (Topic: Web Servers:The Domino Web Server:Hosting Web sites:Web Site rules and global Web settings), you would have seen that putting in mail.mydomain.com in the incoming pattern is not how you should specify the rule.

if entering https://www.otherdomain.com/Folder/file does not work, while there is actually such a file on the specified path, then look for a conflicting Web rule defined for otherdomain.com
Another possibility is Domino is running on a case sensitive OS or file system.
Random Solutions  
 
programming4us programming4us