Coder Profile - Show off your skills, get a coder profile.
 
 
 
code pin board Blog - index.php and admin.php Download Source Code
Author Details Code Information
DannyIsOnFire ( Danny Westhorpe )

Pinned 1 Codes
Posted 0 Coding Articles

Send A Message
View Coders Profile
Language PHP (Hypertext Preprocessor)
Expires Never
Length 17,561 Characters (709 Lines)
Password no password
Description

Some of the source code from a blogging system I'm developing. Need a place to keep it online for a few days, can think of no better or more fitting place than CoderProfile!
  1. // index.php
  2.  
  3. <?php
  4. $website_title = "My Blog";
  5. $website_description = "My blogs description.";
  6. $website_link = "http://www.yourwebsite.com";
  7. $website_name = "Your Name";
  8. $website_email = "you@youremail.com";
  9.  
  10. $database_server = "localhost";
  11. $database_user = "you_you";
  12. $database_password = "demo123";
  13. $database_name = "you_blog";
  14.  
  15. $website_password = "demo123";
  16. $website_entries = 5;
  17.  
  18. function query($sql) {
  19.  
  20. $results = mysql_query($sql);
  21.  
  22. echo mysql_error();
  23.  
  24. return $results;
  25. }
  26.  
  27. function get_value($table,$id,$column) {
  28.  
  29. if ($id == 0) {
  30.  
  31. switch ($table) {
  32.  
  33. case "content":
  34.  
  35. switch ($column) {
  36. }
  37.  
  38. break;
  39. }
  40.  
  41. }
  42.  
  43. else {
  44.  
  45. return mysql_result(query("SELECT $column FROM $table WHERE id=$id"),0,0);
  46. }
  47.  
  48. }
  49.  
  50. function get_comments($article_or_comment, $id) {
  51.  
  52. $sql_where = "parent_id=$id";
  53.  
  54. if ($article_or_comment == "article") {
  55.  
  56. $sql_where = "article_id=$id AND parent_id=0";
  57. }
  58.  
  59. $results = query("SELECT * FROM comments WHERE $sql_where ORDER BY id ASC");
  60.  
  61. while ($row = mysql_fetch_assoc($results)) {
  62.  
  63. if ($row['id'] == $_GET['new_comment']) { $return_string .= "<a name=\"new_comment\"></a>"; }
  64.  
  65. $return_string .= "".prepare_text($row['content']). "<br />---<br />Posted by " .$row['posted_by']." on ".date('F dS Y',$row['date_posted'])."<hr />";
  66.  
  67. if($row['id'] == $_GET['reply_to']) { $return_string .= '<a name="new_message"></a>'.show_form(); }
  68.  
  69. $return_string .= get_comments('comment', $row['id']);
  70. }
  71.  
  72. return $return_string;
  73. }
  74.  
  75. function show_form () {
  76.  
  77. $return_string = '';
  78.  
  79. if ($_GET['new_comment'] == 0) { $return_string .= '<a name="new_comment"></a>'; }
  80.  
  81. $return_string .= '
  82.  
  83. <form name="comment" method="POST" action="index.php?id='.$_GET['id'].'&reply_to='.$_GET['reply_to'].'#new_comment">
  84.  
  85. <input type="hidden" name="parent_id" value="'.$_GET['reply_to'].'">
  86.  
  87. Name:<br /><input type="text" class=\"text_field\" name="posted_by" size="44" value="'.stripslashes($_POST['posted_by']).'">
  88. <br /><br />
  89. Security Question (what is 5+7):<br /><input type="text" class=\"text_field\" name="security" size="44" value="'.stripslashes($_POST['security']).'">
  90. <br /><br />
  91. Comment:<br><textarea class=\"text_field\" name="content" cols="51" rows="5" wrap="virtual">'.stripslashes($_POST['content']).'</textarea>
  92. <br /><br />
  93. <input type="submit" name="submit" value="Submit Comment"> &nbsp;&nbsp;&nbsp; <small>Allowed Tags: &lt;b&gt;&lt;i&gt;&lt;u&gt;&lt;a&gt;</small>
  94.  
  95. '.$_GET['message'].'
  96. </form>
  97. ';
  98.  
  99. return $return_string;
  100.  
  101. }
  102.  
  103. $allowed_tags = '<a><i><b><u>';
  104.  
  105. function prepare_text($text) {
  106.  
  107. global $allowed_tags;
  108.  
  109. $text = str_replace("\n","\n<br>",strip_tags(stripslashes($text),$allowed_tags));
  110.  
  111. $text = preg_replace("/([^\"])(http:\/\/[-\/a-zA-Z0-9%_.?&=]*)/","$1<a href=\"$2\">$2</a>",$text);
  112.  
  113. $text = close_tags($text);
  114.  
  115. return $text;
  116. }
  117.  
  118. function close_tags($text) {
  119.  
  120. global $allowed_tags;
  121.  
  122. $tags_array = explode(">",trim($allowed_tags));
  123.  
  124. array_pop($tags_array);
  125.  
  126. $closing_tags_needed = array();
  127.  
  128. foreach($tags_array as $tag) {
  129.  
  130. $closing_tag = '</'.substr($tag,1);
  131.  
  132. $lower_tag = strtolower($tag);
  133.  
  134. $opening_tag_count = preg_match_all("/$lower_tag( |\>)/",strtolower($text),$tmp); // OLD CODE: substr_count(strtolower($text),strtolower($tag.">"));
  135.  
  136. $closing_tag_count = substr_count(strtolower($text),strtolower($closing_tag.">"));
  137.  
  138. $closing_tags_needed[$tag] = $opening_tag_count - $closing_tag_count;
  139. }
  140.  
  141. foreach ($tags_array as $tag) {
  142.  
  143. for ($i=0; $i<$closing_tags_needed[$tag]; $i++) {
  144.  
  145. $text =$text.'</'.substr($tag,1).">";
  146. }
  147.  
  148. }
  149.  
  150. return $text;
  151. }
  152.  
  153. function write_rss($website_title,$website_description) {
  154.  
  155. $articles = query("SELECT id, author, title, SUBSTRING(content, 1, 256) as content, date_posted FROM content WHERE published='Yes' ORDER BY date_posted DESC LIMIT 10");
  156.  
  157. $rss_text = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns=\"http://purl.org/rss/1.0/\">\r\t<channel rdf:about=\"$_SERVER[SERVER_NAME]\">\r\t\t<title>$website_title</title>\r\t\t<description& gt;$website_description</description>\r\t\t<link>$website_link</link>\r\t\t<items>\r\t\t&# 92;t<rdf:Seq>";
  158.  
  159. while ($article = mysql_fetch_assoc($articles)) {
  160.  
  161. $rss_text .= "\r\t\t\t\t<rdf:li rdf:resource=\"http://$_SERVER[SERVER_NAME]$_SERVER[PHP_SELF]?id=$article[id]\"/>";
  162.  
  163. }
  164.  
  165. $rss_text .= "\r\t\t\t</rdf:Seq>\r\t\t</items>\r\t</channel>";
  166.  
  167.  
  168.  
  169. $articles = query("SELECT id, author, title, SUBSTRING(content, 1, 256) as content, date_posted FROM content WHERE published='Yes' ORDER BY date_posted DESC LIMIT 10");
  170.  
  171. while ($article = mysql_fetch_assoc($articles)) {
  172.  
  173. $rss_text .= "\r\t<item rdf:about=\"http://$_SERVER[SERVER_NAME]$_SERVER[PHP_SELF]?id=$article[id]\">\r\t\t<title>".stripslashes($ article[title])."</title>\r\t\t<description>".stripslashes(str_replace("&","&amp;",strip _tags($article[content])))."...</description>\r\t\t<link>http://$_SERVER[SERVER_NAME]$_SERVER[PHP_SELF]?id=$article[id]&l t;/link>\r\t</item>";
  174.  
  175. }
  176.  
  177. $rss_text .= "\r</rdf:RDF>";
  178.  
  179. $current_directory = $_SERVER[DOCUMENT_ROOT].substr($_SERVER[SCRIPT_NAME],0,strrpos($_SERVER[SCRIPT_NAME],"/"))."/";
  180.  
  181. $filename = $current_directory.'rss.xml';
  182.  
  183.  
  184.  
  185. $tmp = fopen($filename, 'w');
  186.  
  187. fclose($tmp);
  188.  
  189.  
  190.  
  191. if (is_writable($filename)) {
  192.  
  193. if (!$handle = fopen($filename, 'w')) {
  194.  
  195. echo "Cannot open file ($filename)";
  196.  
  197. exit;
  198.  
  199. }
  200.  
  201. if (fwrite($handle, $rss_text) === FALSE) {
  202.  
  203. echo "Cannot write to file ($filename)";
  204.  
  205. exit;
  206.  
  207. }
  208.  
  209. fclose($handle);
  210.  
  211. }
  212.  
  213. else {
  214.  
  215. echo "The file $filename is not writable";
  216.  
  217. }
  218.  
  219. }
  220.  
  221. $db = mysql_connect($database_server, $database_user, $database_password);
  222. mysql_select_db($database_name,$db);
  223. echo mysql_error();
  224.  
  225. if (!$_GET['reply_to']) { $_GET['reply_to'] = 0; }
  226.  
  227. switch ($_GET['action']) {
  228.  
  229. case 'admin':
  230.  
  231. break;
  232. }
  233.  
  234. $_GET['new_comment'] = 0;
  235.  
  236. if ($_POST['submit']) {
  237.  
  238. if ($_POST['posted_by'] == '') { $_GET['message'] = "<br /><br />Please enter your name."; }
  239.  
  240. else if ($_POST['security'] != '12') { $_GET['message'] = "<br /><br />Security question incorrect. Please try again."; }
  241.  
  242. else if ($_POST['content'] == '') { $_GET['message'] = "<br /><br />Please enter a comment."; }
  243.  
  244. else {
  245.  
  246. query("INSERT INTO comments (article_id,posted_by,parent_id,security,content,date_posted) VALUES (".$_GET['id'].",'".$_POST['posted_by']."',".$_POST['parent_id'].",'". $_POST['security']."','".$_POST['content']."',".mktime().")");
  247.  
  248. $_GET['new_comment'] = mysql_insert_id();
  249.  
  250. $_GET['reply_to'] = 0;
  251.  
  252. $_POST = array();
  253. }
  254.  
  255. }
  256. ?>
  257.  
  258. <?php require("admin.php"); ?>
  259.  
  260. <?php
  261. if ($_GET['id'] != "") {
  262.  
  263. $sql = "SELECT * FROM content WHERE published='Yes' AND id=".$_GET['id'];
  264.  
  265. $results = query($sql);
  266.  
  267. while ($row = mysql_fetch_assoc($results)) {
  268.  
  269. echo "\n\n<b>".stripslashes($row['title'])."</b>";
  270.  
  271. echo " | <i>Posted by ".$row['author']." on ".date('F dS Y', $row['date_posted']);
  272.  
  273. echo "</i>\n<br /><br />".prepare_text($row['content'])."<hr />\n";
  274.  
  275. }
  276.  
  277. if ($allow_comments == 'yes') {
  278.  
  279. echo get_comments('article',mysql_result($results,0,0));
  280.  
  281. ?>
  282.  
  283. <?php if (!$_GET['reply_to']) { echo show_form ($_GET['id'],0,$_POST['posted_by'],$_POST['security'],$_POST['content']); } ?>
  284.  
  285. <?php
  286. }
  287. ?>
  288.  
  289. <?php
  290. }
  291.  
  292. else {
  293.  
  294. if (!$_GET[start]) {
  295.  
  296. $_GET[start] = 0;
  297. }
  298.  
  299. if ($_GET['current_subsection'] != 0) {
  300.  
  301. $sql = "SELECT b.* FROM content a, content b WHERE a.id=".$_GET['current_subsection']." AND a.section=b.section AND a.subsection=b.subsection AND a.published='Yes' AND b.published='Yes' ORDER BY date_posted DESC LIMIT $_GET[start],$website_entries";
  302.  
  303. $possible_records = mysql_result(query("SELECT COUNT(b.id) FROM content a, content b WHERE a.id=".$_GET['current_subsection']." AND a.section=b.section AND a.subsection=b.subsection AND a.published='Yes'"),0,0);
  304. }
  305.  
  306. else if ($_GET[action] == 'search') {
  307.  
  308. $sql = "SELECT * FROM content WHERE title LIKE '%$_POST[term]%' OR content LIKE '%$_POST[term]%' AND published='Yes' ORDER BY date_posted DESC";
  309.  
  310. $possible_records = 0;
  311. }
  312.  
  313. else {
  314.  
  315. $sql = "SELECT * FROM content WHERE published='Yes' ORDER BY date_posted DESC LIMIT $_GET[start],$website_entries";
  316.  
  317. $possible_records = mysql_result(query("SELECT COUNT(id) FROM content WHERE published='Yes'"),0,0);
  318. }
  319.  
  320. $results = query($sql);
  321.  
  322. while ($row = mysql_fetch_assoc($results)) {
  323.  
  324. echo "\n<b>".stripslashes($row['title']);
  325. echo "</b> | ";
  326. echo "<i>Posted by $row[author] on ".date('F dS Y', $row['date_posted']);
  327. echo ".</i><br /><br />";
  328. echo "".prepare_text(substr($row[content],0,1500)."...")."\n";
  329. echo "<p align=\"right\"><a href=\"index.php?id=".$row['id']."\">Read More (".mysql_result(query("SELECT COUNT(id) FROM comments WHERE article_id=".$row['id']." AND content<>''"),0,0)." Comments) &#10132;</a></p>";
  330. echo "<hr />";
  331. }
  332.  
  333. if (($possible_records-($_GET[start]+$website_entries)) > 0) {
  334.  
  335. echo "<a href=\"index.php?&start=".($_GET[start]+$website_entries)."\">Previous Blog Entries (".($possible_records-($_GET[start]+$website_entries)).") &#10132;</a>";
  336. }
  337. }
  338. ?>
  339.  
  340.  
  341.  
  342.  
  343.  
  344. // admin.php
  345.  
  346. <?php if ($_GET['action'] == 'admin') { ?>
  347.  
  348. <?php
  349. if ($_GET['task'] == 'list') {
  350.  
  351. $results = query("SELECT * FROM ".$_GET['table']." ORDER BY ".$_GET['orderby']." DESC ");
  352.  
  353. echo "<table cellspacing=\"5\" cellpadding=\"5\" border=\"1\"><tr><td>&nbsp;</td>";
  354.  
  355. for ($i=0;$i<mysql_num_fields($results);$i++) {
  356.  
  357. $field_info = mysql_fetch_field($results, $i);
  358.  
  359. echo "<td><a href=\"index.php?action=admin&amp;task=list&table=".$_GET['table']."&orderby=$field_info->name\"& gt;".ucwords(str_replace('_',' ',$field_info->name))."</td>";
  360. }
  361.  
  362. while ($row = mysql_fetch_assoc($results)) {
  363.  
  364. echo "<tr>\n<tr><td><a href=\"index.php?action=admin&amp;task=edit&table=".$_GET['table']."&id=".$row['id']." 2;">Edit</a>";
  365.  
  366. foreach ($row as $cell) {
  367.  
  368. echo "<td>".strip_tags(stripslashes(substr($cell,0,16)))."</td>";
  369. }
  370.  
  371. echo "</tr>";
  372. }
  373.  
  374. echo "</table><br /><br />";
  375. }
  376. ?>
  377.  
  378. <?php
  379.  
  380. if ($_GET['task'] == 'edit') {
  381.  
  382. $columns_array = array();
  383.  
  384. $columns = mysql_query("SHOW COLUMNS FROM $_GET[table]");
  385.  
  386. while($row = mysql_fetch_object($columns)){
  387.  
  388. $columns_array[$row->Field] = $row->Type;
  389. }
  390.  
  391. $results = query("SELECT * FROM ".$_GET['table']." WHERE id=".$_GET['id']);
  392.  
  393. echo '<form method="post" action="index.php?action=admin&amp;task=update&table='.$_GET['table'].'&id='.$_GET['id'].'&qu ot;><table class="left">';
  394.  
  395. for ($i=0;$i<mysql_num_fields($results);$i++) {
  396.  
  397. $field_info = mysql_fetch_field($results, $i);
  398.  
  399. $field_flags = mysql_field_flags($results, $i);
  400.  
  401. if ($field_info->name != 'id' && substr($field_info->name,0,4) != 'date' && substr($field_info->name,-2) != 'id') {
  402.  
  403. switch (preg_replace("/\(.+\)/","",$columns_array[$field_info->name])) {
  404.  
  405. case "int":
  406.  
  407. echo "\r<tr><td>".ucwords(str_replace("_"," ",$field_info->name))."</td><td><input type=\"text\" class=\"text_field\" name=\"$field_info->name\" value=\"".mysql_result($results,0,$i)."\"></td></tr>";
  408.  
  409. break;
  410.  
  411. case "varchar":
  412.  
  413. echo "\r<tr><td>".ucwords(str_replace("_"," ",$field_info->name))."</td><td>";
  414.  
  415. echo "<input type=\"text\" class=\"text_field\" name=\"$field_info->name\" size=\"45\" value=\"".stripslashes(mysql_result($results,0,$i))."\">";
  416.  
  417. echo "</td></tr>";
  418.  
  419. break;
  420.  
  421. case "blob":
  422.  
  423. echo "\r<tr><td>".ucwords(str_replace("_"," ",$field_info->name))."</td><td><textarea class=\"text_field\" cols=\"52\" rows=\"20\" name=\"$field_info->name\">".stripslashes(mysql_result($results,0,$i))."</textarea></td></tr>" ;;
  424.  
  425. break;
  426.  
  427. case "enum":
  428.  
  429. $values_array = explode(",",preg_replace("/(set|enum)\((.+)\)/","$2",$columns_array[$field_info->name]));
  430.  
  431. echo "\r<tr><td>".ucwords(str_replace("_"," ",$field_info->name))."</td><td>";
  432.  
  433. echo "<select name=\"$field_info->name\" value=\"".stripslashes(mysql_result($results,0,$i))."\">";
  434.  
  435. echo "\r<option value=\"".mysql_result($results,0,$i)."\">".mysql_result($results,0,$i)." (current)</option>";
  436.  
  437. foreach ($values_array as $value) {
  438.  
  439. if (str_replace("'","",$value) != mysql_result($results,0,$i)) {
  440.  
  441. $value = str_replace("'","",$value);
  442.  
  443. echo "\r<option value=\"$value\">$value</option>";
  444. }
  445.  
  446. }
  447.  
  448. echo "</select>";
  449.  
  450. echo "</td></tr>";
  451.  
  452. break;
  453. }
  454.  
  455. }
  456.  
  457. }
  458.  
  459. echo '<tr><td>Password&nbsp;&nbsp;&nbsp;</td><td><input type="password" class="text_field" size="45" name="password"><tr><td>&nbsp;</td><td><br /><input type="submit" class="button" value="Submit Changes"></td></tr><tr><td>&nbsp;</td></tr></table></form>';
  460.  
  461. echo '<hr />';
  462.  
  463. echo '<form action="index.php?action=admin&amp;task=delete&table='.$_GET['table'].'&id='.$_GET['id'].'&qu ot; method="post"><div class="article_text">Password: <input type="password" class="text_field" size="33" name="password"> <input type="submit" class="button" value="Delete Post"></form>';
  464.  
  465. echo '<br /><br /><b><u>You will not be able to undo this - be careful!</u></b>';
  466.  
  467. echo '<hr /><br /><br />';
  468. }
  469. ?>
  470.  
  471. <?php
  472.  
  473. if ($_GET['task'] == 'update') {
  474.  
  475. $sql = "UPDATE ".$_GET[table]." SET ";
  476.  
  477. while(list($key, $value) = each($HTTP_POST_VARS)) {
  478.  
  479. if ($key != "password") {
  480.  
  481. $sql .= "$key=";
  482.  
  483. if (is_numeric($value)) { $sql .= "$value, "; }
  484.  
  485. else { $sql .= "'".addslashes($value)."', "; }
  486. }
  487.  
  488. }
  489.  
  490. $sql .= "date_modified=".mktime()." WHERE id=".$_GET['id'];
  491.  
  492. if ($_POST['password'] == $website_password) {
  493.  
  494. query($sql);
  495.  
  496. echo "Success! Your entry has been posted.<br /><br />";
  497. write_rss(,$website_description);
  498. }
  499.  
  500. else { echo "Incorrect password. Please try again.<br /><br />"; }
  501. }
  502. ?>
  503.  
  504. <?php
  505.  
  506. if ($_GET['task'] == 'delete') {
  507.  
  508. if ($_POST['password'] == $website_password) {
  509.  
  510. query("DELETE FROM ".$_GET['table']." WHERE id=".$_GET['id']);
  511.  
  512. echo "Success! Entry deleted.<br /><br />";
  513. write_rss(,$website_description);
  514. }
  515.  
  516. else { echo "Incorrect password. Please try again.<br /><br />"; }
  517. }
  518. ?>
  519.  
  520. <?php
  521.  
  522. if ($_GET['task'] == 'add') {
  523.  
  524. $results = query("SELECT * FROM ".$_GET['table']." LIMIT 1");
  525.  
  526. $columns_array = array();
  527.  
  528. $columns = mysql_query("SHOW COLUMNS FROM $_GET[table]");
  529.  
  530. while($row = mysql_fetch_object($columns)){
  531.  
  532. $columns_array[$row->Field] = $row->Type;
  533. }
  534.  
  535. echo '<form method="post" action="index.php?action=admin&amp;task=insert&table='.$_GET['table'].'"><table class="left">';
  536.  
  537. for ($i=0;$i<mysql_num_fields($results);$i++) {
  538.  
  539. $field_info = mysql_fetch_field($results, $i);
  540.  
  541. $field_flags = mysql_field_flags($results, $i);
  542.  
  543. if ($field_info->name != 'id' && substr($field_info->name,0,4) != 'date' && substr($field_info->name,-2) != 'id') {
  544.  
  545. switch (preg_replace("/\(.+\)/","",$columns_array[$field_info->name])) {
  546.  
  547. case "int":
  548.  
  549. echo "\r<tr><td>".ucwords(str_replace("_"," ",$field_info->name))."</td><td><input type=\"text\" class=\"text_field\" name=\"$field_info->name\"></td></tr>";
  550.  
  551. break;
  552.  
  553. case "varchar":
  554.  
  555. echo "\r<tr><td>".ucwords(str_replace("_"," ",$field_info->name))."</td><td>";
  556.  
  557. echo "<input type=\"text\" class=\"text_field\" size=\"45\" name=\"$field_info->name\">";
  558.  
  559. echo "</td></tr>";
  560.  
  561. break;
  562.  
  563. case "blob":
  564.  
  565. echo "\r<tr><td>".ucwords(str_replace("_"," ",$field_info->name))."</td><td><textarea class=\"text_field\" cols=\"52\" rows=\"20\" name=\"$field_info->name\"></textarea></td></tr>";
  566.  
  567. break;
  568.  
  569. case "enum":
  570.  
  571. $values_array = explode(",",preg_replace("/(set|enum)\((.+)\)/","$2",$columns_array[$field_info->name]));
  572.  
  573. echo "\r<tr><td>".ucwords(str_replace("_"," ",$field_info->name))."</td><td>";
  574.  
  575. echo "<select name=\"$field_info->name\">";
  576.  
  577. foreach ($values_array as $value) {
  578.  
  579. $value = str_replace("'","",$value);
  580.  
  581. echo "\r<option value=\"$value\">$value</option>";
  582. }
  583.  
  584. echo "</select>";
  585.  
  586. echo "</td></tr>";
  587.  
  588. break;
  589. }
  590.  
  591. }
  592.  
  593. }
  594.  
  595. echo '<tr><td>Password&nbsp;&nbsp;&nbsp;</td><td><br /><input type="password" size="45" class="text_field" name="password"><tr><td>&nbsp;</td><td><br /><input type="submit" class="button" value="Submit Entry"></td></tr><tr><td>&nbsp;</td></tr></table></form>';
  596. }
  597. ?>
  598.  
  599. <?php
  600.  
  601. if ($_GET['task'] == 'insert') {
  602.  
  603. $sql = "INSERT INTO ".$_GET[table]." (";
  604.  
  605. while(list($key, $value) = each($HTTP_POST_VARS)) {
  606.  
  607. if ($key != "password") { $sql .= "$key, "; }
  608. }
  609.  
  610. $sql .= " date_posted) VALUES (";
  611.  
  612. reset($HTTP_POST_VARS);
  613.  
  614. while(list($key, $value) = each($HTTP_POST_VARS)) {
  615.  
  616. if ($key != "password") {
  617.  
  618. if (is_numeric($value)) { $sql .= "$value, "; }
  619.  
  620. else { $sql .= "'".addslashes($value)."', "; }
  621. }
  622.  
  623. }
  624.  
  625. $sql .= mktime().")";
  626.  
  627. if ($_POST['password'] == $website_password) {
  628.  
  629. query ($sql);
  630.  
  631. echo "Success! Your entry has been posted.<br /><br />";
  632. write_rss(,$website_description);
  633. }
  634.  
  635. else { echo "Incorrect password. Please try again.<br /><br />"; }
  636. }
  637. ?>
  638.  
  639. <?php if (!$_GET['task']) { ?>
  640.  
  641. <b><u>Admin Area</u></b>
  642. <br />
  643. You will need your password to add, edit or remove content.
  644. <br /><br />
  645.  
  646. <?php } ?>
  647.  
  648. What do you want to do next?
  649. <br />
  650. <a href="index.php?action=admin&amp;task=add&table=content">Make A Post</a> | <a href="index.php?action=admin&amp;task=list&table=content&orderby=id">Edit A Post</a> | <a href="index.php?action=admin&amp;task=list&table=comments&orderby=id">Moderate Comments</a> | <a href="index.php">&laquo; Back To My Blog</a>
  651. <br /><br />
  652. Need some help? Check out the <b>Drag&amp;Drop Blog</b> website for installation instructions, frequently asked questions and more.
  653. <br />
  654. <a href="http://www.dannywesthorpe.co.uk/web-development/" target="_blank">http://www.dannywesthorpe.co.uk/web-development/</a>
  655. <br /><br /><hr /><hr /><br />
  656. <?php
  657. }
  658. ?>
code pin board Back To Code Pin Board Post New Code
Please login to post comments.
Page 1 of 1
 
 
Latest News About Coder Profile
Coder Profile Poll
Which sounds better on your coder profiles, and makes more sense to you (think twitter, facebook, etc)?

Followers / Following
Fans / Following
Fans / Fan Of


please login to cast your vote
and see the results of this poll
Latest Coder Profile Changes
Coder Profile was last updated
3.49 Years Ago
Official Blog :: Make A Donation :: Credits :: Contact Me
Terms & Conditions :: Privacy Policy :: Documents :: Wallpapers
Version 1.46.00
Copyright © 2007 - 2012, Scott Thompson, All Rights Reserved