I got the html form, output from which i want to save in database. Everything is ok, but after user presses "submit" my php file becoming free2see. I found a way out :
header("Location: exampleurl");
die();
in
$phone=$_POST['phone'];
$pointA=$_POST['pointA'];
$pointB=$_POST['pointB'];
$con = mysql_connect("127.0.0.1", "root", "");
mysql_set_charset('utf8');
mysql_select_db("taxon");
$query="INSERT INTO `order` (phone, pointA, pointB)
VALUES ('$phone', '$pointA', '$pointB')";
$result= mysql_query($query, $con);
mysql_close($con);
header("Location: exampleurl");
die();
?>
which is situated at the bottom of the document, to alow php run the code and then redirect. I don't like this way because it's apropriate for low-data files. If there would be alot of code to proceed, 1st) user will see empty page, ater he'll get redirection. Can you advise me something? P.S. My english is lame please tell me if smth wrong , i'll fix that .