急求怎样实现php中的页面返回? 用php写了个网页,网页中有一个表单,表单提交给另一个页面处理。我想问:“怎样写代码,在表单提交的内容不符合要求时返回表单所在页面,可以重新填写表单内容?” 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?php if($_POST['email'] == '') { echo "<script language=\"javascript\">\n"; echo "alert('请填写您的邮箱')\n"; echo "history.back()\n"; echo "</script>"; }是不是要这样 <?php if($_POST['email'] == '') {echo"emile不能为空,2秒后自动返回!";echo "<meta http-equiv=refresh content='2;url=./xxx.php'>"; } <script>function check(){ if(document.myform.email.value==''){ alert('请填写您的邮箱'); myform.email.focus(); return false; } return true;}</script><form name="myform" action="" onsubmit="check()">................ <?php if(empty($_POST['username'])){ echo "<script>alert('用户名不能为空');history.back()</script>" {?> 在提交页面做检测时<script language=javascript charset='utf-8'><!--alert('信息不符合!');history.back(-1);--></script> file_get_contents获取XML的奇怪问题 各位大神,这是为什么呢?数据总插入不成功。 高手为我解答谷歌地图难题,,可恶的客户 实现内容中只显示中文, 小菜提问:开发环境的配置。 为什么我不管用post方法还是用get方法都无法显示数据? [求助]PHP通过ODBC造作Access的问题 FCKeditor 在Smarty中怎么用 都是session捣的鬼,救我~~~ 希望有空间的朋友帮忙|? 一个页面多个编辑器,在线等 pear php 使用问题
<?php
if($_POST['email'] == '') {
echo "<script language=\"javascript\">\n";
echo "alert('请填写您的邮箱')\n";
echo "history.back()\n";
echo "</script>";
}
是不是要这样
if($_POST['email'] == '') {
echo"emile不能为空,2秒后自动返回!";
echo "<meta http-equiv=refresh content='2;url=./xxx.php'>";
}
function check(){
if(document.myform.email.value==''){
alert('请填写您的邮箱');
myform.email.focus();
return false;
}
return true;
}
</script>
<form name="myform" action="" onsubmit="check()">
................
if(empty($_POST['username'])){
echo "<script>alert('用户名不能为空');history.back()</script>"
{
?>
<!--
alert('信息不符合!');
history.back(-1);
-->
</script>