Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as PHP by manchev ( 15 years ago )
<?php
mysql_connect('localhost', 'root', '');
mysql_select_db('comments');
if(isset($_POST['go'])){
mysql_query("INSERT INTO comments (user, comment) VALUES ('{$_POST['username']}', '{$_POST['comment']}')");
}
$select = mysql_query("SELECT * FROM comments");
while($r = mysql_fetch_array($select)){
echo "<p>User: {$r['user']}<br />";
echo "Comment: {$r['comment']}<br /></p>";
}
?>
<form action="" method="POST">
<input type="text" name="username" /><br /><br />
<textarea name="comment"></textarea><br /><br />
<input type="submit" name="go" value="Go" />
</form>
Revise this Paste