phpget取不到值解决思路
                        
                            时间:2021-07-01 10:21:17
                            帮助过:31人阅读
							                        
                     
                    
                    php get取不到值
//自动跳转
//header("Content-Type:text/html; charset=utf-8");
$type=$_GET['type'];
$ID=$_GET[id];
$url="show_user.php";
$id=$_POST["id"];
//$title= $_POST["title"];
$password = $_POST["password"];
//date_default_timezone_set("Asia/Shanghai");
//php.ini里加入了date.timezone这个选项,默认情况下是关闭的,也就是显示的时间(无论用什么php命令)都是格林威治标准时间,和北京时间正好差8个小时。
//$time = date("Y-m-d H:i:s");//获得当前时间
$con = mysql_connect("localhost","root","123");
if(!$con)
{
	die('连接数据库失败!'.mysql_error());
}
//header("Content-Type:text/html; charset=utf-8");
mysql_select_db("test", $con);
mysql_query("set names 'utf8'",$con);
echo "中国";
switch ($type)
{
	case edit:
		$sql = "update test set id='$id',pass='$password' where id='$id'";
	    $qu = mysql_query($sql,$con);
		if($qu)
		{
			echo  "";
			exit;
		}
	break;
	case add:
		if(!mysql_query("INSERT INTO test (id,pass) values ('$id','$password')"))
		{
			die('数据插入失败!'.mysql_error());
		}
		else
		{
			echo "";
			exit;
		}
		break;
	case dele:
		$sql ="delete from test where id ='$ID'";
	    $qu=mysql_query($sql,$con);
		if($qu)
		{
             echo "";
			exit;
		}
		break;
}
/*
// 插入数据库
*/
?>
为什么$_GET['type']取不到值
------解决方案--------------------
switch ($type)
{
case "edit":
//加引号