All pastes #166929 Raw Edit

Someone

public text v1 · immutable
#166929 ·published 2006-09-11 13:35 UTC
rendered paste body
<?php

include 'includes/dbconnect.inc.php';
mysql_select_db("misc");

if($_POST["submit"])
{
   $time=date("h:ia d/j/y");
   $result=mysql_query("INSERT INTO sample (id,name,time)".
      "VALUES ('NULL','$_POST[name]','$_POST[time]')");
}
$result = mysql_query("select * from sample order by id desc limit 3");
while($row=mysql_fetch_array($result))
{		
   echo $row['time']; 
   echo $row['id'];
   echo $row['name'];
 } 
?>

<form action="<?php echo $php_self ?>" method="post">
<input TYPE='TEXT' value='name' NAME='name' SIZE=30 maxlength='100'><br>
<input TYPE='TEXT' value='message' NAME='message' SIZE=30 maxlength='100'>
<input type="submit" name="submit" value="submit">
</form>