Hello this is my registration form I need to without @ and .com badges could not register because now p.v.z. enters the login name and any subsequent email adsasdasdqwd and they can register to do or which one you can perasyti this code that should be added to normal email with @ and .com badges, and otherwise prevent register if missing @ and .
[php]<?php
require(‘config.php’);
$tbl_name=“forum_user”;
mysql_connect("$host", “$username”, “$password”)or die(“cannot connect”);
mysql_select_db("$db_name")or die(“cannot select DB”);
$username=str_replace($invalidchars,"",$_POST[‘username’]);
$password=md5($_POST[‘password’]);
$email=str_replace($invalidchars,"",$_POST[‘email’]);
$metai=str_replace($invalidchars,"",$_POST[‘metai’]);
$realname=str_replace($invalidchars,"",$_POST[‘realname’]);
if (!$username) { die(‘Uzpildei nevisus laukus’); }
if (!$password) { die(‘Uzpildei nevisus laukus’); }
if (!$email) { die(‘Uzpildei nevisus laukus’); }
$sql = mysql_query(“SELECT * FROM $tbl_name WHERE username=’$username’”);
$num_rows = mysql_num_rows($sql);
if ($num_rows > 0) {
die (‘Sis prisijungimo vardas jau uzimtas’);
}
$sql2=“INSERT INTO $tbl_name(username, metai, password, email, realname)VALUES(’$username’, ‘$metai’, ‘$password’, ‘$email’, ‘$realname’)”;
$result2=mysql_query($sql2);
if($result2){
header(“Location: created_user.php”);
}
else {
echo “ERROR”;
}
mysql_close();
?>
[/php]