doujue9767 2013-04-24 08:50
浏览 525
已采纳

在哪里可以找到PHP输出/日志

I am a beginner web developer, specifically, with PHP and some front-end techniques (HTML,CSS,JS/JQuery). I found in some situations, it's quite difficult find the bugs in PHP code. Here is one of examples:

In a HTML page, I use JQuery to submit (with post) a form to a PHP file for back-end transaction. Since I am using JQuery, the page will not be redirected to the PHP page, so if the PHP code has some bugs (even some stupid syntax / SQL errors), it can be hardly to detect them when we test them with a normal navigator.

My question is : if I use echo in the PHP page in the above case, where will the output reside ? I think there should exist some log files for all these sorts of output. What's more, if there are some bugs in the JavaScript, are there any tricks to quickly locate the bugs ?

PS: I am using PHPStorm as IDE under MAC OS.

  • 写回答

5条回答 默认 最新

  • douxin0251 2013-04-24 08:55
    关注

    When you are running AJAX (it sounds that way judging from your question), all jQuery is doing is request the page 'for you'. So instead that you can directly see the output, jQuery will 'catch' it for you. An AJAX request is nothing more than a normal HTTP request, just in the background so you won't see it.

    Therefore; when you 'echo' something, it will just be handled by jQuery and therefore sent to your browser.

    There are some tools like firebug that allow you to look into the request and response from your ajax messages, and thus displaying possible errors or different output too. It's an all-around debugger, so you can also see your rendered HTML and/or JavaScript errors.

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

报告相同问题?

悬赏问题

  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来