dtx3006 2011-12-15 08:41
浏览 59

如何在在线预订系统中实现超时

I am developing a online hotel reservation system and I have found the need to put a timer that limits the time a customer can finish his reservation. I am doing this because of some concurrency issues. The timer would span starting from the selection of rooms until after the payment is completed.

I am planning to use paypal but I am not sure if it has a timer feature ( the confirm payment button will be disabled once the time runs out ).

My flow goes like this: Select Room Page -> customer information page (start timer) -> Payment (paypal) -> Result page

Any suggestions are welcome... (I am new to web development) Thanks in advance..

  • 写回答

1条回答 默认 最新

  • dongpouda6700 2011-12-15 08:44
    关注

    You can always store an UNIX style time in a session:

    session_start();
    $_SESSION['start'] = time();
    

    And when you want to finish it, you can get the timestamp difference (time elapsed) by subtracting the stored time from the current one:

    time() - $_SESSION['start'];

    Check http://php.net/time for more information.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题