首页 > 开发 > ThinkPHP > 正文

ThinkPHP中自定义错误页面和提示页面

2020-10-12 21:16:44
字体:
来源:转载
供稿:网友
  1. <html> 
  2. <head> 
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
  4. <title>提示消息 - ThinkPHP</title> 
  5.  
  6. <style type="text/css"
  7. body { font: 75% Arail; text-align: center; } 
  8. #notice { width: 300px; background: #FFF; border: 1px solid #BBB; background: #EEE; padding: 3px; 
  9. position: absolute; left: 50%; top: 50%; margin-left: -155px; margin-top: -100px; } 
  10. #notice div { background: #FFF; padding: 30px 0 20px; font-size: 1.2em; font-weight:bold } 
  11. #notice p { background: #FFF; margin: 0; padding: 0 0 20px; } 
  12. a { color: #f00} a:hover { text-decoration: none; } 
  13. </style> 
  14. </head> 
  15. <body> 
  16. <div id="notice"
  17. <div style="width:100%;text-align:left;padding-left:10px;padding-right:10px"
  18. <?php echo $e['message']; ?> 
  19. </div> 
  20. <p style="font: italic bold 2cm cursive,serif; color:red"
  21. × 
  22. </p> 
  23.  
  24. <p> 
  25. 在( <span id="sec" style="color:blue;font-weight:bold">3</span> )秒后自动跳转,或直接点击 <a href="javascript:window.location='<?php echo __APP__;?>'">这里</a> 跳转<br> 
  26. <span style="display:block;text-decoration:underline;cursor:pointer;line-height:25px" onclick="stop(this)">停止</span> 
  27. </p> 
  28. </div> 
  29. <script> 
  30. var seco=document.getElementByIdx_x("sec"); 
  31. var time=3; 
  32. var tt=setInterval(function(){ 
  33. time--; 
  34. seco.innerHTML=time; 
  35. if(time<=0){ 
  36. window.location='<?php echo __APP__;?>' 
  37. return
  38. }, 1000); 
  39. function stop(obj){ 
  40. clearInterval(tt); 
  41. obj.style.display="none"
  42. </script> 
  43. </body> 
  44. </html> 

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选