drhwb470572 2012-07-07 09:17
浏览 6

重定向标题

I have an email form, that i'm validating a date, its a booking form. What im doing is when the start date is bigger than the end date it gives me a message saying to fix the date and redirect to the page. I have 2 pages, the page of the booking form, and when i click to submit it goes to the contact_engine page to validate and send the email:

here is how i put it:

if ($datebegin >= $dateend){
    echo '<script>alert("Fix the Date");</script>'; 

exit;

The problem is when it does the exit it stays in the functions page, and i want it to exit but go to the previous page. Can someone give me some help? I tried instead using exit. I try to use it with header("Refresh: 1; url=http:/website.com/booking.php"); but somehow this takes me to the to the sent_page_booking page.

  • 写回答

4条回答 默认 最新

  • drnf593779 2012-07-07 10:18
    关注

    What about doing a timed redirect, so that the user gets the error message shown:

    header("refresh:5;url=back-to-booking-form.php");
    echo 'Form Error. Fix the date. Redirecting to the booking form in about 5 secs.'; 
    
    评论

报告相同问题?

悬赏问题

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