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(<?xml version="1.0" encoding="iso-8859-1"?> <response> <error>1</error> <message>Invalid Trackback ID</message> </response> '; exit; }else { id = blogName = mysql_escape_string(title = mysql_escape_string(excerpt = excerpt) > 252) { excerpt, 0, 252) . "..."; } excerpt); _GET[id]', '_POST[title]', '_POST[excerpt]')"; insertQuery(<?xml version="1.0" encoding="iso-8859-1"?> <response> <error>0</error> </response> '; exit; } }else if (is_numeric(_GET['entry'])) { _GET['entry']}'"; }else { blogEntries = getAssoc(blogEntries AS pageURL = "http://example.preinheimer.com/blog/index.php"; echo "<h2> {</a></h2>\n"; echo "<b>{entry['category']}</b>\n"; echo "<p>{</p>\n"; echo "<a href=\"mailto:{$entry['email']}\">{entry['name']}</a>\n"; echo "({<br>"; echo "<a href=\"postURL?action=trackback&id={</a>"; echo '<!--\n<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"> <rdf:Description rdf:about="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.