hey guys... iam gettin undiffine connection sql...can you help please...
php:
register form:
btw...its not for world of warcraft server
php:
PHP:
<?php
if(isset($_POST["submit"])){
if($_POST['regpassword'] == $_POST['regcpassword']){
if(!empty($_POST['regusername']) && !empty($_POST['regpassword'])) {
$user=$_POST['regusername'];
$pass=$_POST['regpassword'];
$email=$_POST['regemail'];
$con=mysql_connect('AMIR-PC\SQLEXPRESS','sa','FD9D60B133f498b') or die(mysql_error());
mysql_select_db('dnmembership') or die("cannot select DB");
$query=mysql_query("SELECT * FROM Accounts WHERE AccountName='".$user."'");
$numrows=mysql_num_rows($query);
if($numrows==0){
$sql="INSERT INTO Accounts(AccountName,NxLoginPwd,AccountEmail) VALUES('$user','$pass','$email')";
$result=mysql_query($sql);
if($result){
echo "Account Successfully Created";
} else {
echo "Failure!";
}
} else {
echo "That username already exists! Please try again with another.";
}
} else {
echo "All fields are required!";
}
}else{
echo "passwords are not match";
}
}
?>
HTML:
<form action="" method="post" id="register-form" novalidate>
<div class="register-body">
Username<br/>
<input name="regusername" type="text" class="type4"/>
<br/>Password<br/>
<input name="regpassword" id="regpassword" type="password" class="type4"/>
<br/>Confirm Password<br/>
<input name="regcpassword" type="password" class="type4"/>
<br/>E-Mail Address<br/>
<input name="regemail" type="text" class="type4"/>
<br/>Security Image<br/>
<input name="regcaptcha" type="text" class="type4" maxlength="5"/>
<table width="338" border="0" cellspacing="0" cellpadding="0" style="margin-top:10px;">
<tr>
<td><img src="includes/captcha502b.png?_CAPTCHA&t=0.43569700+1428219637" alt="CAPTCHA"/></td>
<td valign="top" align="center">
<div class="input type2 type4" style="display: inline-block">
<input name="submit" type="submit" value="SUBMIT" class="button" id="submit"/>
<div class="hover"></div>
</div>
<div class="input type2 type3 type4" style="display: inline-block">
<input name="reset" type="reset" value="RESET ALL" class="button" id="reset"/>
<div class="hover"></div>
</div>
</td>
</tr>
</table>
</div>
</form>
btw...its not for world of warcraft server
Last edited: