PHP Classes

File: fwphp/glomodul/z_examples/book_video/03steinmetz_2008/ch12_Projects/blog_edit.php

Recommend this page to a friend!
  Classes of Slavko Srakocic  >  B12 PHP FW  >  fwphp/glomodul/z_examples/book_video/03steinmetz_2008/ch12_Projects/blog_edit.php  >  Download  
File: fwphp/glomodul/z_examples/book_video/03steinmetz_2008/ch12_Projects/blog_edit.php
Role: Example script
Content type: text/plain
Description: Example script
Class: B12 PHP FW
Manage database records with a PDO CRUD interface
Author: By
Last change:
Date: 3 months ago
Size: 765 bytes


Class file image Download

if (
$_REQUEST["submit"]) {
$content = mysql_escape_string(strip_tags($_REQUEST["content"],
$teaser = substr(strip_tags($content), 0, 80);
$title = mysql_escape_string(strip_tags($_REQUEST["title"]));
$category = mysql_escape_string(strip_tags($_REQUEST["category"]));
$q = "INSERT INTO blog_entries
             (title, content, category, teaser, entry_time)
      VALUES ('
$title', '$content', '$category', '$teaser', now())";
mysql_query($q, $connection) or die(mysql_error());
$id = mysql_insert_id($connection);
header("Location: blog_display.php?ID=$id");
} else {
$smarty->assign("title", "blog: post an entry");

For more information send a message to info at phpclasses dot org.