Forums
Home / Developing with WordPress / $_GET not working inside header.php
(@italoborges)
7 years, 6 months ago
Hello,
I’m having this problem from nowhere because was working before. There is a blue bar where I get the query string and put inside the bar using:
<div class="nombre-site"><? if(!empty($_GET['asearch'])) echo $_GET['asearch']; ?></div>
Now, on localhost is working, on production not. WordPress is converting the php code above into a comment tag.
Anyone can help me?
The page I need help with: [log in to see the link]
(@sterndata)
Volunteer Forum Moderator
You must use <?php, not <?. This is a PHP setting that’s set poorly on your localhost and correctly on your production site.
<?php
<?
Thank you so much, Steve! It worked!!
(@italoborges)
7 years, 6 months ago
Hello,
I’m having this problem from nowhere because was working before.
There is a blue bar where I get the query string and put inside the bar using:
<div class="nombre-site"><? if(!empty($_GET['asearch'])) echo $_GET['asearch']; ?></div>
Now, on localhost is working, on production not. WordPress is converting the php code above into a comment tag.
Anyone can help me?
The page I need help with: [log in to see the link]