Question

I have:

  <a href="settings.php?yeah=<?php echo $yeah;?> & word=<? echo $word;?">Settings</a>

and in settings php:

  <? echo $_GET['yeah'];
     echo $_GET['word'];
  ?>

The problem is that it is working only for yeah.

Was it helpful?

Solution

You just need to remove the spaces between the variables in href :

 <a href="settings.php?yeah=<?php echo $yeah;?>&amp;word=<?php echo $word;?"> Settings </a>

OTHER TIPS

  <a href="settings.php?yeah=<?php echo $yeah;?>&word=<?php echo $word;?">Settings</a>

remove spaces and I'm strongly recommending use <?php not just <?

You must remove the extra spaces around the '&' sign, like this:

<a href="settings.php?yeah=<?php echo $yeah;?>&word=<? echo $word;?">Settings</a

Remove space from it

<a href="settings.php?yeah=<?php echo $yeah;?>&amp;word=<?php echo $word;?">Settings</a>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top