a pastebin project

Unnamed

  1. <?php
  2.  
  3. // Other code
  4.  
  5. function addnews129($id) {
  6.  
  7.     global $db;
  8.    
  9.  
  10.          session_start();
  11. if(!isset($_SESSION['admin']) && !isset($_SESSION['password'])){
  12. echo '<center><h3>Error!</h3></center>You do not have sufficeint permission to view this page.';
  13.  
  14. }else{
  15.  
  16.  
  17.     $query = "SELECT * FROM news WHERE id=$id";
  18.     $result = mysql_query ($query);
  19.     echo "<center><h3>Add News</h3></center>\n";
  20.    
  21.    
  22.     echo "<FORM action=\"{$_SERVER['PHP_SELF']}" .
  23.          "?action=addnews\" method=POST>\n";
  24.     echo "Title: <input type=\"text\" " .
  25.          "size=\"30\" name=\"title\"><BR>\n";
  26.     echo "<TEXTAREA cols=\"40\" rows=\"5\" " .
  27.          "name=\"news\"></TEXTAREA><BR>\n";
  28.     echo "<input type=\"submit\" name=\"submit\" " .
  29.          "value=\"Add News\"\n";
  30.     echo "</FORM>\n";
  31.     }
  32.      
  33. }
  34.  
  35. // Other code that has nothing to do with this function...just a switch statement...
  36.  
  37. ?>

advertising

Create a Paste

Please enter your new post below (or upload a file instead):





Please note that information posted here will not expire by default. If you want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords.

fantasy-obligation