dqsk4643 2017-08-21 13:01
浏览 18
已采纳

“?”和GET方法之间的关系?

I was wondering what might be the relation between the question mark, the variable after the question mark ('show' in this case) and the way it is being passed to the GET method in PHP. Also, why don't we use POST instead of GET?

<?php 

    if (isset($_GET['show'])
       echo $_GET['show'];

?>
<input type="submit" onClick="window.location='index.php?
show=include.inc.php'">

Oh, and the file I am working on is index.php and upon a click, it shows the content of include.inc.php.

Please help. Sorry for any stupid questions.

  • 写回答

3条回答 默认 最新

  • duansha7453 2017-08-21 13:06
    关注

    The question mark denotes that there is a variable to follow!

    The way that the $_GET function works is by passing the variables through the URL itself! In this case, its like putting up a sign that says "Hey, show is equal to include.inc.php".

    $_POST does the same, but more discreetly. Instead of passing it through the URL, it creates a little package that travels to the receiver, similar to the postal system.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度