2015-04-28 61 views
0

我想弹出“请返回并检查我不是机器人盒子”,我该怎么办?这是html页面弹出显示文本

如果未选择验证码,系统将显示此项(Google验证码)。

if(isset($_POST['g-recaptcha-response'])){ 
     $captcha=$_POST['g-recaptcha-response']; 
    } 
    if(!$captcha){ 
     echo '<h2>Please go back and check the I am not a robot box.</h2>'; 
     exit; 
    } 

在此先感谢您。

回答

0

您可以使用JavaScript警告框。

警报(“请回去检查我不是机器人箱子。”);

http://www.w3schools.com/js/js_popup.asp

如果你宁愿有什么更好的(而且它可能是一个警告框,可以解释为错误一个更好的主意),我会用一个jQuery弹出去,对话效果很好,这里有一个快看看它是如何在代码中实现:

$('#dialog-confirm').dialog("option", "buttons", [ 
     { 
      text: 'Please go back and check the I am not a robot box.', 
      click: function() { $("#dialog-confirm").dialog("close"); } 
     } 
]); //end buttons 

$('#dialog-confirm').dialog("open"); 

https://jqueryui.com/dialog/

+0

由于它的工作! – Behrouzjaz