Location: PHPKode > projects > crelab > creblog/admin/post.php
<?php
include("adco.php");

if (!isset($_POST['submit'])) {
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<head>
   <title><?php echo $title ?></title>
   <link href="style/style.css" rel="stylesheet" type="text/css" />
   <script language="javascript" type="text/javascript" src="js/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
	mode : "textareas",
	theme : "advanced",
	theme_advanced_buttons3 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",

});
</script>
</head>
<!-- START OF HIDDEN HTML - PLACE YOUR CONTENT HERE -->

<body>
  <div id="main">
    <div id="caption"><?php echo $title ?> - Blog it.</div>
      <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
      
      
          <div class="headline">Title:</div>
          <input type="text" name="title" size="40"/>
          <br/><br/>
          
          <div class="headline">Name:</div>
          <input type="text" name="name" size="40"/>
          <br/><br/>
          
          
        <div class="headline">Content:</div><br/>
        <textarea name="newstext" rows="15" cols="67"></textarea><br/>
        
          <div class="headline">Url Link:</div> <input name="linkpfad" type="text" size="10"/> <div class="headline">Url Text:</div> <input name="linktext" type="text" size="10"/>
          <br/><br/>
        
        
        <center><input type="submit" name="submit" value="Save" /></center>
     </form> 
     
     <div id="source"><a href="index.php">BACK TO ADMINISTRATION PAGE</a> | simple blogging system by <a href="http://crelab.de">crelab.de</a></div>
  </div>
</body>   

<?php } else {
   $newsTitel   = isset($_POST['title']) ? $_POST['title'] : 'Untitled';
   $submitDate  = date('d.m.Y G:i:s');
   $newsContent = isset($_POST['newstext']) ? $_POST['newstext'] : 'No Content';
   $newsName   = isset($_POST['name']) ? $_POST['name'] : 'No Name';
   $newsLinkPfad   = isset($_POST['linkpfad']) ? $_POST['linkpfad'] : 'No Link';
   $newsLinkText   = isset($_POST['linktext']) ? $_POST['linktext'] : 'No Link';
   
   $filename = date('YmdHis');
   $f = fopen('../news/'.$filename.".txt","w+");         
   fwrite($f,$newsTitel."\n");
   fwrite($f,$submitDate."\n");
   fwrite($f,$newsContent."\n");
   fwrite($f,$newsName."\n");
   fwrite($f,$newsLinkPfad."\n");
   fwrite($f,$newsLinkText."\n");
   fclose($f);

   header('Location:index.php');   
}
?>
Return current item: crelab