<?$dbconn=mysql_connect("localhost","root","********" ); $status=mysql_select_db("test", $dbconn);?>
<FORM action="<?=$_SERVER['PHP_SELF']?>" method="post">
<p> Type your name and Address here<br>
<input type=text name="name" >
<input type=text name="address" >
<input type=text name="phone" >
<br>
<input type=submit name=submission value=SUBMIT>
</p>
</FORM>
<?php
if (isset($POST['submission']))
{
$V2=$POST['name'];
$V3=$POST['address'];
$V4=$POST['phone'];
$I="INSERT INTO table1(name, address, phone, time) VALUES('$V2', '$V3', '$V4', '".date("Y-m-d-H-m-s" )."')";
$I=@($I);
}
?>
(1) the webpage with above code will show 3 input form boxes(name, address, phone number).
(2) if a user input the 3 data into the box, and click the submit button, the data will be inserted into table1 of the test database,
and the page will be stayed for another data input.
(3) I want to make the page will move to another page(newpage.php) after the data is sent to the DB.
(4) In order to make it, I tried to change the part
<FORM action="<?=$_SERVER['PHP_SELF']?>" method="post">
into
<FORM action="newpage.php" method="post">.
(5) the result of changing makes the page move to another page(newpage.php) . but the data are not to inserted to the DB.
(6) How can I make the code to work as I intended.
(7) what I intend is that the page will move to another page with
inserting the data into DB.