dongqieli4164 2010-08-17 09:38
浏览 34
已采纳

PHP自定义URL MySQL集成

New to PHP, would love to get to know it better. Currently working on a project around RSS + SMS gateway for users to get alerts on certain events around them.

I have a MySQL table with auto_increment ID's, assigned systematically. I'd like to create a PHP page that allows the user to go to http://mysite.com/page.php?id=Mysql_ID - which in-turn loads the MySQL ID row (everything I specify it to load [msg,title,date])

What sort of things should I be looking into?

I have made a custom PHP search, but it isnt perfect yet.

Dont expect anyone to code anything, but would like to know what it's called (the '?q=' bit)

  • 写回答

1条回答 默认 最新

  • dongmao3131 2010-08-17 09:47
    关注

    The part of an URL after the ? sign is the query string; what the HTTP GET protocol uses to pass data. In PHP the data in there is available as $_GET['q'].

    E.g. If you have the URL example.com?name=John&id=7, the following would be true:

    <?php
    echo $_GET['name']; // John
    echo $_GET['id']; // 7
    ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条