Location: PHPKode > projects > Mirroring Boards > add_msg.php
<?

if (isset ($_POST['add']))
 {
mysql_connect ("localhost", "www.beng", "2pebv8mn");
mysql_select_db ("www_beng");

  $request = mysql_query ("SELECT * FROM mb_users WHERE login=\"".$_POST['author']."\"");
  @extract (mysql_fetch_array ($request), EXTR_PREFIX_ALL, "auth");

  if ($auth_pass == $_POST['pass'])
   {

/*
** AUTHENTIFICATION Ok
**  Posting the new message :)
*/
    $sql = "INSERT INTO mb_msg (thread, title, msg, author, date) ";
    $sql.= "VALUES ('".$_POST['thread']."', '".$_POST['title']."', ";
    $sql.= "'".$_POST['msg']."', '".$_POST['author']."', ";
    $sql.= "'".mktime(date("H,i,s,m,d,Y"))."')";
    mysql_query ($sql);

    echo "<a href=list_msg.php?thread=".$_POST['thread'].">See Message</a><br><br>\n";

   }
  else
   {
    echo "AUTHENTIFICATION ERROR !<br><br>\n";
   }
  mysql_close();
 }
else
 {
  echo "<table><tr><td align=center>\n";
  echo "<script language=\"JavaScript\" src=\"md5.js\"></script>\n";
  echo "<script language=\"Javascript\">\n";
  echo " function encode()\n";
  echo " { document.add_form.pass.value = hex_md5 (document.add_form.pass.value); }\n</script>\n";
  echo "<form name=add_form action=add_msg.php method=post>\n";
  echo "<input type=hidden name=thread value=$thread>\n";
  echo "<input type=hidden name=add value=true>\n";
  echo "<input type=text name=author value=author size=15 maxlenght=15><br>\n";
  echo "<input type=password name=pass value=password size=32><br>\n";
  echo "<input type=text name=title value=title size=30 maxlenght=30><br>\n";
  echo "<textarea name=msg rows=8 cols=30></textarea><br>\n";
  echo "<input type=submit value=post onclick=\"encode();\">\n";
  echo "</table><br><br>\n";
  include ("list_msg.php");
 }

include ("md5_info.php");

?>
Return current item: Mirroring Boards