Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter screener

    (@screener)

    Sorry, to access varA in the following url:

    https://myDom.com/myPage?varA=Hello&varB=World

    You just call:

    <?php echo $_GET[“varA”]; ?>

    This isn’t working for me….I’m trying to pass a variable in the url. Its hard coded on the page like:

    <a href="?p=1?varA=1">links to single.php</a>

    on single.php I put the above code
    <?php echo $_GET["varA"]; ?>

    and nothing shows up.

    any help appreciated. Been trying for two hours now to get a variable to pass…

    <?php isset($_GET[‘referredlink’]); $_GET[‘referredlink’]; ?>

    something like that… I just recently had to do something for an if statement and that is the gist of what I had to get it to work, ymmv

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do I pass a variable through the url in wp?’ is closed to new replies.