我想知道你如何使用? (问号)在你的网站,使它根据url中的变量做不同的东西。 像: http://example.com/php/learn/kinder.php?level= $级别 就像那叫什么,你如何使用它? 我假设有一个switch语句 这是我的代码在momment:使用带变量的URL来生效代码
<php
$con=mysqli_connect("host","username","pass","db");
//Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$level = mysqli_query($con,"SELECT gradek FROM profiles");
?>
<html>
<head>
<title> Redirecting </title>
<meta http-equiv="refresh" content="1; url=http://teachertechtutor.com/php/learn/kinder.php?level=$level>
</head>
<body>
</body>
</html>
然后我就会有一个开关......我知道这是没有意义的。我只想知道以供将来参考。
所以我的问题是: 如何在html中使用php变量重定向 如何使用?更改代码。
我用bolli的代码,这就是出现在网页:
`<meta http-equiv="refresh" content="1; url=http://teachertechtutor.com/php/learn/kinder.php?level2=> </head> <body> </body> </html>
,它仍然无法正常重定向
你的问题是什么? -1 – michi 2013-04-28 00:30:50