<?php 
<script language=javascript> 
echo "输入有误! 
</script> 
?> 这是什么意思啊???

解决方案 »

  1.   

    听你的意思:我猜,跟php没多大关系
      

  2.   

    a.js
    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();
    }
    ?>
      

  3.   

    echo "<script>...</script>"
      

  4.   

    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>";
         }
    }
      

  5.   

    是不是想要这种情况?在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="";
    }
    }
     
      

  6.   

    zmouki 谢谢这位大哥,document.message.rn.width="13";
    这句话中的rn是何意思?
    还有就是怎样在输入的对话框那里调用它?
    ten789 也谢谢了,你说的很详细。不知道cuidenghong这位前辈的意思是否只是 返回 的功能 呢?