douda5227 2012-12-13 03:21
浏览 114
已采纳

使用PHP $ _GET更正超链接URL的语法

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 from the URL.

I was just wanting to put it in a link like <a href="mywebsite.com/page?name=$name"></a> So would it work if I did it like that, and if it would, how would I get it from the URL?

  • 写回答

3条回答 默认 最新

  • doucheng9634 2012-12-13 03:26
    关注

    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'];
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?