[wpkg_web] / hosts_xml_out.php Repository:
ViewVC logotype

View of /hosts_xml_out.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (download) (annotate)
Sun Dec 17 05:01:35 2006 UTC (11 years, 7 months ago) by linuxkidd
File size: 715 byte(s)
Added ability to D/L individual XML files for packages/profiles/hosts.
Added XML icon.
Added tool tips on hover of certain areas.
Added GPL v2 License copy

<?php
include "connect.php";

$hosts_sql="select hosts.regex as regex,profiles.name as name from hosts left join profiles on (hosts.prof_id=profiles.id)";

if (isset(
$_GET['id'])) {
  
$hosts_sql.=" where hosts.id=" quote_smart($_GET['id']);
}

$hosts_sql.=" order by hosts.priority";

$hosts_h=mysql_query($hosts_sql) or die ($hosts_sql " --- " mysql_error());

header('Content-type: text/xml');
header('Content-Disposition: attachment; filename="hosts.xml"');


print 
"<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";
print 
"<wpkg>\n";

while(
$host_data=mysql_fetch_array($hosts_h)) {
  print 
sprintf("  <host name='%s' profile-id='%s' />\n",$host_data['regex'], $host_data['name']);

}
print 
"</wpkg>\n";

?>

ViewVC Help
Powered by ViewVC 1.0.3