Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在页面之间再次发送变量?_Php - Fatal编程技术网

Php 在页面之间再次发送变量?

Php 在页面之间再次发送变量?,php,Php,我想在我的webshop上使用这个概念,但是如何发送变量呢? (您知道index.php?Page=test&variable=22//变量不起作用) 此链接工作正常!:php?Page=test 此链接不起作用(表示该页面不存在):nywebsite.php?page=test&item=5可能的错误: 1) 您在URL中使用空格(在您使用的示例中) 2) 在php中,您使用$\u GET['side']-而不是$\u GET['Page']或$\u GET['variable'] 3) 如果

我想在我的webshop上使用这个概念,但是如何发送变量呢? (您知道index.php?Page=test&variable=22//变量不起作用)

此链接工作正常!:php?Page=test

此链接不起作用(表示该页面不存在):nywebsite.php?page=test&item=5

可能的错误:

1) 您在URL中使用空格(在您使用的示例中)

2) 在php中,您使用$\u GET['side']-而不是$\u GET['Page']或$\u GET['variable']

3) 如果要在发送后在所有页面中保存变量,可以使用会话:

$_SESSION['get_saved_param__Page'] = $_GET['Page'];
使用standart会很好

if {
  // code
} else {
  // code
}

因为它更容易阅读,而且您将花费大部分时间在阅读脚本而不是编写代码上。

您可以使用、发布或会话来存储数据并访问另一个php脚本?您是否确实在url中使用空格?如果是的话,你不应该。和
'side'!='第“
页。请使用此$Page=isset($\u GET['Page'])更改您的条件?修剪(strtolower($_GET['Page']):“front”;什么是“不起作用”,如何?请去读。不,不。。我在链接中不使用空格。我已经更正了代码
if {
  // code
} else {
  // code
}