Correct syntax for hyperlink URL with PHP $_GET

后端 未结 3 380
我在风中等你
我在风中等你 2020-12-06 23:56

I am wondering how I would put information from my website in the URL on the first page of my site, and then on the next page, use $_GET to get the variables fr

相关标签:
3条回答
  • 2020-12-06 23:59

    do

    <a href="http://mywebsite.com/page?name=<?php echo $name; ?>"></a>
    

    And in your page, you could get the name as:

    $name = $_GET['name'];
    
    0 讨论(0)
  • 2020-12-07 00:17

    the $_GET is the variable. so in this case, to get the name, it would be:

    $_GET['name'];
    
    0 讨论(0)
  • 2020-12-07 00:24

    Example Link: http://example.com/page.php?name=Charles

    If you used $_GET["name"] it would return the value Charles

    For more information on $_GET look at http://php.net/manual/en/reserved.variables.get.php

    0 讨论(0)
提交回复
热议问题