Het is een stuk vriendelijker als je gewoon de relevante code - is geen geheel script - hier post.
mm zoveel code is het nu ook weer niet:
<?php
//include the connect-script
include("connect.php");
//if the superglobal $_POST['name'] is set, insert the data in the database
if(isset($_POST['name'])){
mysql_query("INSERT INTO users (name)
VALUES ('$_POST['name']')";
//else, echo the form
}else{
echo '<form method="post" action="">
Naam: <input type="text" name="name" /><br />
<input type="submit" value="Registreren!" />
</form>';
}
?>
Het is een stuk vriendelijker als je gewoon de relevante code - is geen geheel script - hier post.
mm zoveel code is het nu ook weer niet:
<?php
//include the connect-script
include("connect.php");
//if the superglobal $_POST['name'] is set, insert the data in the database
if(isset($_POST['name'])){
mysql_query("INSERT INTO users (name)
VALUES ('$_POST['name']')";
//else, echo the form
}else{
echo '<form method="post" action="">
Naam: <input type="text" name="name" /><br />
<input type="submit" value="Registreren!" />
</form>';
}
?>