hmm well i recieve the error:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/jmonnet/public_html/data/database.php on line 17
and on line 17 i have
header("Location: $_POST['redirect']");
from
if (isset($POST['redirect'])) {
header("Location: $POST['redirect']");
}
You see i have to pages.. here is the one with the form:
<body>
<form action="database.php" method="post">
<input name="nume">
<input name="prenume">
<input type="submit">
<input type="hidden" name="redirect" value="http://www.data.jmonnet.ro/view.php">
</form>
</body>
And here is database.php:
<?
$nume=$POST['nume'];
$prenume=$POST['prenume'];
$username="jmonnet_test";
$password="*******";
$database="jmonnet_test";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "INSERT INTO tabel VALUES ('','$nume','$prenume')";
mysql_query($query);
mysql_close();
if (isset($POST['redirect'])) {
header("Location: $POST['redirect']");
}
?>
🙂 🙂 what to do..?