<?php
if(isset($_POST['Murad'])){header("localtion: http://localhost/murad/centil/o/Main.php");
$firstname=$_POST['firstname'];
$lastname=$_POST['lastname'];
$userName=$_POST['username'];
$password=$_POST['pwd1'];
$email=$_POST['email'];
$mysql_hostname = "localhost";
$mysql_user = "root";
$mysql_password = "123";
$mysql_databse = "websiteusers";
$prefix = "";
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Could not connect database");
$sql = "INSERT INTO websiteusers
(fullname,lastname,userName,email,pass)
VALUES ( '$firstname', '$lastname','$userName', '$email','$password')";
mysql_select_db('websiteusers');
$retval = mysql_query( $sql );
if(! $retval )
{
die('Could not enter data: ' . mysql_error());
return false;
}echo "Entered data successfully\n";
}
?>
此文件中没有包含或没有空格,因此它不会显示任何错误,它也会插入数据,但它会保留在同一页面上
答案 0 :(得分:0)
标题不正确,必须说:
header("Location: http://localhost/murad/centil/o/Main.php");