<?php
session_start();
include("connect.php");

if ($htmlorphp=="1"){
$fff = "result.html";
}else{
$fff = "result.php";
}

$text1 = rand(0,9);
$text2 = rand(0,9);
$text3 = "<label for='xzx5'>".$LANGAUGE[176]." ".$text1." + ".$text2."</label>";
$text4 = $text1 + $text2;

$_SESSION["captchacode"] = $text4;

tpl_header($LANGAUGE[64]);
bar($namelinks1,$LANGAUGE[64],"","");

?>
<script type='text/javascript'>

function regCheck(submitform) {
var correct = true;
var emailPat = "[_:/.=+%&-'\"*#;]";
var matchArray = submitform.namesearch.value.match(emailPat);
var count = 0;

if (submitform.namesearch.value == '') {
        correct = false;
        alert('<?php echo $LANGAUGE[174]; ?>');
        submitform.namesearch.focus();

} else if (submitform.code.value == '') {
        correct = false;
        alert('<?php echo $LANGAUGE[177]; ?>');
        submitform.code.focus();

} else if (matchArray != null) {
        correct = false;
        alert('<?php echo $LANGAUGE[256]; ?>');
        submitform.namesearch.focus();
}

if (correct) {
        submitform.submit();
}

}
</script>
<?php
$search = "<form name='signup' action='".$fff."' method='post'>
<input id='sdf' type='text' name='namesearch' size='50' onfocus=\"this.select()\" /> <label for='sdf'>".$LANGAUGE[257]."</label><br />
<input id='xzx5' name='code' size='10' dir='ltr' onfocus=\"this.select()\" /> ".$text3."<br />
<input type='button' value=' ".$LANGAUGE[65]." ' name='Sendx' id='Sendx' onclick=\"regCheck(signup)\" />
</form>";

table($LANGAUGE[64],$search,1);
tpl_footer();
?>