Public paste
asd
By: asd | Date: Apr 1 2010 11:04 | Format: PHP | Expires: never | Size: 763 B | Hits: 840

  1. $id = (int) rand(10000,99999);
  2.                         $title = mysql_escape_string($_POST['title']);
  3.                         $author = mysql_escape_string($_POST['author']);
  4.                         $language = $_POST['language'];
  5.                         $ip = $_SERVER['REMOTE_ADDR'];
  6.                         $text = mysql_escape_string($_POST['text']);
  7.                         $date = date("d/m/y");
  8.                         $sql = "INSERT INTO 0xPaste (
  9.                                                                                 id,
  10.                                                                                 author,
  11.                                                                                 title,
  12.                                                                                 ip,
  13.                                                                                 language,
  14.                                                                                 text,
  15.                                                                                 data
  16.                                                                                 ) VALUES (
  17.                                                                                 '{$id}',
  18.                                                                                 '{$author}',
  19.                                                                                 '{$title}',
  20.                                                                                 '{$ip}',
  21.                                                                                 '{$language}',
  22.                                                                                 '{$text}',
  23.                                                                                 '{$date}');";
  24.         mysql_connect($dbhost,$dbuname,$dbpass);
  25.         mysql_select_db($dbname) or die( "SQL Error:".mysql_error());
  26.         mysql_query($sql);
  27.         mysql_close();