21,886
社区成员
发帖
与我相关
我的任务
分享
后来将phpstrom的页面放到xampp的htdocs下,修改一下htdocs下面的index.php,在浏览器地址栏输入localhost,访问就可以了。
希望帮助到出现同样问题的人。
<?php
if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
$uri = 'https://';
} else {
$uri = 'http://';
}
$uri .= $_SERVER['HTTP_HOST'];
header('Location: '.$uri.'/boboil/');
exit;
?>
Something is wrong with the XAMPP installation :-(
上面的boboil是我修改index.php的部分。<?php
/**
* Created by PhpStorm.
* User: 541464750
* Date: 2016/1/13
* Time:$$ 0:49
*/
//if(!isset($_GET['fname']))
//{
// die("no name");
//}
//if(!isset($_GET['age']))
//{
// die("no age");
//}
require_once "connectDB.php";
print_r( $_GET );
//var_dump($_GET;
$fname = $_GET[ 'fname' ];
$age = $_GET[ 'age' ];
$conn = connectDB();
mysqli_query( $conn, "INSERT INTO user(name,age) VALUES ('$fname','$age')" );
//header( "Location:alluser.php" );
?>