我可以在元 http 等效刷新中传递变量吗?


Can I pass a variable in a meta http equiv refresh

我可以在 Meta HTTP equiv 刷新中传递变量吗?

我使用上面的页面作为参考,但答案 #2 无法正常工作。我的代码:

<meta http-equiv="refresh" content="5; URL=mem_list.php?filename='$init'">

$_GET['filename'];mem_list.php接收文件名条目作为"$init"而不是它应该是的变量。 如果代码?filename=J,它可以正常工作,但如果代码?filename='$init'?filename=' . $init . '则不能工作。

尝试类似下面的方法,您必须告诉 php 回显您的变量:

<meta http-equiv="refresh" content="5; URL=mem_list.php?filename=<?php echo urlencode($init); ?>">

你不必这样做:

<meta http-equiv="refresh" content="5; URL=mem_list.php?filename='<? echo $init; ?>'">