topical media & game development
server-webapi-code-04-index.php / php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<title>My Sample Blog</title>
<link rel="alternate" type="application/rss+xml" title="RSS"
href="http://example.preinheimer.com/blog/feed.php">
</head>
<body>
<h1>Sample Blog</h1>
<?php
include("./common_db.php");
if (_POST['url'] == "")
{
echo '<?xml version="1.0" encoding="iso-8859-1"?>
<response>
<error>1</error>
<message>URL required</message>
</response>
';
exit;
}else if (!is_numeric(id = blogName = mysql_escape_string(title = mysql_escape_string(excerpt = excerpt) > 252)
{
excerpt, 0, 252) . "...";
}
excerpt);
_GET[id]', '_POST[title]', '_POST[excerpt]')";
insertQuery(_GET['entry']))
{
_GET['entry']}'";
}else
{
blogEntries = getAssoc(blogEntries AS pageURL = "http://example.preinheimer.com/blog/index.php";
echo "<h2>
{entry['category']}</b>\n";
echo "<p>{entry['name']}</a>\n";
echo "({postURL?action=trackback&id={pageURL?entry=' . pageURL?entry=' . entry['subject'] . '"
trackback:ping="entry['id'] . '" />
</rdf:RDF>\n-->';
}
//echo "<pre>";
//print_r(parse_url("http://www.preinheimer.com/blog/test/asd"));
//print_r(parse_url("http://www.preinheimer.com/"));
//print_r(parse_url("http://www.preinheimer.com"));
//echo "</pre>";
function checkLinkBack(localURL)
{
remoteURL));
if (stristr(localURL) != FALSE)
{
return true;
}else
{
return false;
}
}
function checkBadWords(wordList = array('debt', 'poker', 'weight-loss', 'phentermine', 'diet');
foreach(word)
{
if (stristr(word) != FALSE)
{
return false;
exit;
}
}
return true;
}
function checkURL(urlInfo = parse_url(urlInfo['path'] > 1))
{
return true;
}else
{
return false;
}
}
?>
</body>
</html>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.