http = NewHttp("The URL to my php file")
rsp = http.GetToStringWithRetry()
xml=CreateObject("roXMLElement")
if not xml.Parse(rsp) then
print "Can't parse feed"
else
print "working"
endif
http://www.mysite.com/env.cgi?type=movie&title=%22Some%20Movie%22
DOCUMENT_ROOT = /home/me/mysite.com
GATEWAY_INTERFACE = CGI/1.1
HTTP_ACCEPT = text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_ENCODING = gzip, deflate
HTTP_ACCEPT_LANGUAGE = en-us
HTTP_CONNECTION = keep-alive
HTTP_DNT = 1
HTTP_HOST = www.mysite.com
HTTP_USER_AGENT = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.1.25 (KHTML, like Gecko) Version/8.0 Safari/600.1.25
PATH = /usr/local/bin:/usr/bin:/bin
QUERY_STRING = type=movie&title=%22Some%20Movie%22
REMOTE_ADDR = xxx.xxx.xxx.xxx
REMOTE_PORT = 49733
REQUEST_METHOD = GET
REQUEST_URI = /env.cgi?type=movie&title=%22Some%20Movie%22
SCRIPT_FILENAME = /home/me/mysite.com/env.cgi
SCRIPT_NAME = /env.cgi
SCRIPT_URI = http://www.mysite.com/env.cgi
SCRIPT_URL = /env.cgi
SERVER_ADDR = xxx.xxx.xxx.xxx
SERVER_ADMIN = webmaster@mysite.com
SERVER_NAME = www.mysite.com
SERVER_PORT = 80
SERVER_PROTOCOL = HTTP/1.1
SERVER_SIGNATURE =
SERVER_SOFTWARE = Apache
UNIQUE_ID = VHyhV0BvfxsAAAyZGpIAAAAD
http://yourserveraddress.com/search.php?table=movies&search=Rocky
<?php
$servername = ""; //This is your server address
$username = ""; //This is the username to access the database
$password = ""; //This is the password to access the database
$dbname = ""; //This is the name of the database
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `".$_GET['table']."` WHERE `Title` REGEXP CONVERT( _utf8 '".$_GET['search']."' USING latin1 ) COLLATE latin1_swedish_ci LIMIT 0 , 30 ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// echo the XML declaration
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
//echo the XML section
echo '<movies>';
while($row = $result->fetch_assoc()) {
echo "<item><title>".$row["Title"]."</title><description>". $row["Description"]."</description></item>";
}
echo '</movies>';
} else {
echo "0 results";
}
$conn->close();
?>