Location: PHPKode > scripts > Orochimu contact > index.php
<?php
/**
 * Orochimu - contact script 1.0
 * **************************
 * Written by Orochimu
 * **************************
 * http://orochimu.web-pro.hu
 * **************************
 * You can contact me at hide@address.com
 * **************************
 * You can use, modify, and redistribute this script.   
 */

require_once("config.php");
require_once("languages/".$language.".php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-2" />
	<meta name="author" content="Orochimu" />
    <meta http-equiv="Content-Script-Type" content="text/javascript" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
	<title>Orochimu - contact - 1.0</title>
    <link rel="stylesheet" href="styles/<?php echo($style) ?>.css" type="text/css"   />
<script type="text/javascript">
    vname = /[^a-zA-Z0-9]/;
    ok="<img src='images/ok.png' alt='ok' border='0' />";
    function namev(){
        if(document.getElementById('name').value.length<2){
            document.getElementById('nameerror').innerHTML='<?php echo($lng[0]) ?>';
            document.getElementById('name').className  ="red";
            return false;
                    
        }
        else if(vname.test(document.getElementById('name').value)==true){            
            document.getElementById('nameerror').innerHTML="<?php echo($lng[1]) ?>";
            document.getElementById('name').className  ="red";                   
            return false;
                    
                    
        }
        else{
            document.getElementById('nameerror').innerHTML=ok;
            document.getElementById('name').className  ="";
            return true;                    
            
        }
    }
    function emailv() {        
    	   var vchars = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/;
    	   if(vchars.test(document.getElementById('email').value) == false) {
                document.getElementById('emailerror').innerHTML="<?php echo($lng[2]) ?>";
                document.getElementById('email').className  ="red"; 
                return false;           
    	   }
    	   else{ 	       
               document.getElementById('emailerror').innerHTML=ok;
               document.getElementById('email').className  ="";
               return true;                
    	   }
   	}    
    function messagev(){
        if(document.getElementById('message').value.length<5){
            document.getElementById('messageerror').innerHTML="<?php echo($lng[3]) ?>";
            document.getElementById('message').className  ="red";          
            return false;
        }
        else{
            document.getElementById('messageerror').innerHTML=ok;
            document.getElementById('message').className  ="";
            return true;
        }
    }
    function act(){
        if(namev()==true && emailv()==true && messagev()==true ){
            document.getElementById('submit').disabled=true;
            document.getElementById('submit').value="<?php echo($lng[4]) ?>";
    
            var xmlhttp;
            
            if (window.XMLHttpRequest){  
                xmlhttp=new XMLHttpRequest();
            }
            else{                
                xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
            xmlhttp.onreadystatechange=function(){
                if(xmlhttp.readyState==4 && xmlhttp.status==200){
                    document.getElementById('load').innerHTML="";
                    if(xmlhttp.responseText=="ok"){
                        document.getElementById('submit').value="<?php echo($lng[5]) ?>";
                            }
                    else{
                         document.getElementById('submit').disabled=false;
                         document.getElementById('submit').value="<?php echo($lng[6]) ?>";
                    }
                }
                else{
                     document.getElementById('load').innerHTML="<img src='images/load.gif' alt='töltés' border='0' />";
                }
            }
                xmlhttp.open("POST","check.php",true);
                xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
                xmlhttp.setRequestHeader("Connection", "close");                
                xmlhttp.send("s_y=1&name="+document.getElementById("name").value+"&message="+document.getElementById("message").value+"&email="+document.getElementById("email").value);
   
                  
            }
        }
    
     
	
</script>
</head>

<body>
<div align="center" id="main">
    <div id="submitdiv" align="center" class="submit">
        <form method="post" action="javascript:return false">
            <label for="name"><?php echo($lng[7]) ?></label>
            <input onchange="namev()" class="" id="name" type="text" name="name"  />
            <div style="float:left" id="nameerror"></div>
            <br />
            <label for="email"><?php echo($lng[8]) ?></label>
            <input onchange="emailv()" id="email" type="text" name="email"  />
            <div style="float:left" id="emailerror"></div>
            <br />
            <label for="message"><?php echo($lng[9]) ?></label>
            <textarea onchange="messagev()" rows="5" cols="40" id="message" name="message"></textarea>
            <div style="float:left" id="messageerror"></div>
            <br />
           <label for="submit">&nbsp;</label> <input class="button" id="submit" type="submit" onclick="act()" value="<?php echo($lng[10]) ?>" />
        </form>
    </div>
    <br />
    <center><small><a href="http://orochimu.web-pro.hu" target="_blank">By Orochimu</a></small></center>
</div>
<div class="load" id="load"></div>

</body>
</html>
Return current item: Orochimu contact