那位前辈教小弟做php中的封装函数的过程? <?php <script language=javascript> echo "输入有误! </script> ?> 这是什么意思啊??? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 听你的意思:我猜,跟php没多大关系 a.jsfunction countDown(secs,surl){ tiao.innerText=secs; if(--secs>0){ setTimeout("countDown("+secs+",'"+surl+"')",1000); } else{ location.href=surl; } }error.php<?funciton error($msg, $url){ echo '<p>输入有误:'.$msg.'</p><script scr="a.js">countDown('5', '.$url.')</script>';}?>index.php<?if($_POST['id'] === ''){ include('error.php'); error('ID不能为空', 'index.php'); exit();}?> echo "<script>...</script>" public function pob($msg,$url){ if($url=="-1"){ echo "<script language='javascript'> alert('".$msg."');history.back(-1);</script>"; } else{ echo"<script language='javascript'> alert('".$msg."');window.location.href='".$url."';</script>"; } } 是不是想要这种情况?在JavaScript里做,不是在PHP中做,你要的效果是输入完就会有显示,如果你写在PHP里,那要提交会才能看到效果。/* 检查用户名*/function checkrgname(){ if (document.message.rgname.value.length<5) { document.message.rn.src="images/check_error.gif"; document.message.rn.width="13"; document.message.rn.height="13"; warning_rn.innerText="用户名过短!!"; } else { document.message.rn.src="images/check_right.gif"; document.message.rn.width="13"; document.message.rn.height="13"; warning_rn.innerText=""; }} zmouki 谢谢这位大哥,document.message.rn.width="13";这句话中的rn是何意思?还有就是怎样在输入的对话框那里调用它?ten789 也谢谢了,你说的很详细。不知道cuidenghong这位前辈的意思是否只是 返回 的功能 呢? 怎样让FTP上传文件的权限自动变成777? 有意兼职的朋友进来看看! 关于康盛Discuz!X中的UCenter mysql_fetch_array()输出两条记录 冰天雪地赤身裸体跪求高手解决APACHE配置题(有配置文件) get参数中有字符+,怎么取值? 兄弟们过来帮我看下这个问题,如果取出返回的值? 寻找php交易平台源代码 利用gd怎么显示汉字?在线等待! qsnake & leemars 请来拿分 php 字符串 按位异或 关于header函数跳转的问题
function countDown(secs,surl){
tiao.innerText=secs;
if(--secs>0){
setTimeout("countDown("+secs+",'"+surl+"')",1000);
}
else{
location.href=surl;
}
}error.php
<?
funciton error($msg, $url)
{
echo '<p>输入有误:'.$msg.'</p><script scr="a.js">countDown('5', '.$url.')</script>';
}
?>index.php
<?
if($_POST['id'] === ''){
include('error.php');
error('ID不能为空', 'index.php');
exit();
}
?>
if($url=="-1"){
echo "<script language='javascript'> alert('".$msg."');history.back(-1);</script>";
}
else{
echo"<script language='javascript'> alert('".$msg."');window.location.href='".$url."';</script>";
}
}
/* 检查用户名*/
function checkrgname()
{
if (document.message.rgname.value.length<5)
{
document.message.rn.src="images/check_error.gif";
document.message.rn.width="13";
document.message.rn.height="13";
warning_rn.innerText="用户名过短!!";
}
else
{
document.message.rn.src="images/check_right.gif";
document.message.rn.width="13";
document.message.rn.height="13";
warning_rn.innerText="";
}
}
这句话中的rn是何意思?
还有就是怎样在输入的对话框那里调用它?
ten789 也谢谢了,你说的很详细。不知道cuidenghong这位前辈的意思是否只是 返回 的功能 呢?