简体   繁体   中英

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'] .

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.

try using <?php ?> instead of <? ?> <? ?>

And <?php echo $variable;?> instead of <?=$variable;?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM