[英]PHP 5.3.3 _server['query_string'] ERROR
I'm using wordpress on a PHP server 5.3.3 and i got error when i try to get the $_SERVER['QUERY_STRING']
. 我在PHP服务器5.3.3上使用wordpress,当我尝试获取$_SERVER['QUERY_STRING']
时出现错误。
My code below: 我的代码如下:
$query_string = $_SERVER['QUERY_STRING'];
if($current_user->user_nicename == "admin"){
echo '<a class="button add_to_cart_button product_type_simple" href="#" target="_blank" >Lista cursos</a>';
if(isset($_GET['demo'])){
if (strpos($query_string,'&demo') !== false)
$enlacesindemo = str_replace("&demo","",$query_string);
}
}
?>
<a class="button add_to_cart_button product_type_simple" href="index.php?<?= $enlacesindemo ?>" target="_self">Ver todos</a>
And i got this as link: 我得到这个作为链接:
index.php?<?= $query_string ?>&demo
short_open_tags in not enabled by your server. 服务器未启用short_open_tags 。
try using <?php ?>
instead of <? ?>
尝试使用<?php ?>
代替<? ?>
<? ?>
And <?php echo $variable;?>
instead of <?=$variable;?>
和<?php echo $variable;?>
而不是<?=$variable;?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.