itotakao
07-31-2002, 07:34 AM
I would like to do that after entering my datas, I dont' want to show my form(texts) again. I jsut want to show" Thank you filling out my form" Also I would like to make a link to my Home.
That's it.
please tell me easy way to do my request
Thank you
Here is my code
<html>
<body>
<?php
$con = mysql_connect("localhost","itohideo","1234");
if(!$con)
{
print("Fail DB Connection<br>\n");
exit;
}
if(!mysql_select_db("itohideo"))
{
print("Fail DB Selection<br>\n");
exit;
}
if (isset($_POST["submit"]))
{
$number = $_POST["number"];
$name = $_POST["name"];
$country = $_POST["country"];
$query_insert = "insert into takao (number, name, country) values ('$number', '$name', '$country')";
$query_result_insert = mysql_query($query_insert, $con) or die (mysql_error($con));
echo "Thank you for filling out my form";
mysql_close($con);
}
?>
<form method="post" action="<?php $_SERVER['PHP_SELF']; ?>">
<P>please fill out this form and it goes to my database</P>
Number<input name="number" type="text"><br>
Name<input name="name" type="text"><br>
You country<input name="country" type="text"><br>
<input type="submit" name="submit">
<input type="reset" name="reset">
</form>
</body>
</html>
That's it.
please tell me easy way to do my request
Thank you
Here is my code
<html>
<body>
<?php
$con = mysql_connect("localhost","itohideo","1234");
if(!$con)
{
print("Fail DB Connection<br>\n");
exit;
}
if(!mysql_select_db("itohideo"))
{
print("Fail DB Selection<br>\n");
exit;
}
if (isset($_POST["submit"]))
{
$number = $_POST["number"];
$name = $_POST["name"];
$country = $_POST["country"];
$query_insert = "insert into takao (number, name, country) values ('$number', '$name', '$country')";
$query_result_insert = mysql_query($query_insert, $con) or die (mysql_error($con));
echo "Thank you for filling out my form";
mysql_close($con);
}
?>
<form method="post" action="<?php $_SERVER['PHP_SELF']; ?>">
<P>please fill out this form and it goes to my database</P>
Number<input name="number" type="text"><br>
Name<input name="name" type="text"><br>
You country<input name="country" type="text"><br>
<input type="submit" name="submit">
<input type="reset" name="reset">
</form>
</body>
</html>