Junior Spellweaver
- Joined
- Jul 14, 2011
- Messages
- 144
- Reaction score
- 3
index.php
register.php
config.php
made this myself its no throwing any errors or anything but it isnt inserting anything into the account tbl in realmd database and also wondering if sumone can help me with how to add in the
sha1///hash stuff required for the registration
ive found this for the password but im having trouble figuring out how to add this into my script bear with me please first time ever making my own php scripts
//sha1(strtoupper($username).':'.strtoupper($this -> password));
this is newest register.php
but it dont seem to insert anything into the table still and from the looks of it it should be working
<form name="reg" action="register.php" method="post">
<table width="274" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td colspan="2">
<div align="center">
<?php
$remarks=$_GET['remarks'];
if ($remarks==null and $remarks=="")
{
echo 'Register Here';
}
if ($remarks=='success')
{
echo 'Registration Success';
}
?>
</div></td>
</tr>
<tr>
<td width="95"><div align="right">UserName:</div></td>
<td width="171"><input type="text" name="fname" /></td>
</tr>
<tr>
<td><div align="right">password:</div></td>
<td><input type="text" name="lname" /></td>
</tr>
<tr>
<td><div align="right">gmlvl:</div></td>
<td><input type="text" name="mname" /></td>
</tr>
<tr>
<td><div align="right">expansion:</div></td>
<td><input type="text" name="address" /></td>
</tr>
<tr>
<td><div align="right"></div></td>
<td><input name="submit" type="submit" value="Submit" /></td>
</tr>
</table>
</form>
<table width="274" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td colspan="2">
<div align="center">
<?php
$remarks=$_GET['remarks'];
if ($remarks==null and $remarks=="")
{
echo 'Register Here';
}
if ($remarks=='success')
{
echo 'Registration Success';
}
?>
</div></td>
</tr>
<tr>
<td width="95"><div align="right">UserName:</div></td>
<td width="171"><input type="text" name="fname" /></td>
</tr>
<tr>
<td><div align="right">password:</div></td>
<td><input type="text" name="lname" /></td>
</tr>
<tr>
<td><div align="right">gmlvl:</div></td>
<td><input type="text" name="mname" /></td>
</tr>
<tr>
<td><div align="right">expansion:</div></td>
<td><input type="text" name="address" /></td>
</tr>
<tr>
<td><div align="right"></div></td>
<td><input name="submit" type="submit" value="Submit" /></td>
</tr>
</table>
</form>
register.php
<?php
include('config.php');
$username=$_POST['username'];
$sha_pass_hash= sha1(($username) . ":" . ($password));
$GMLVL=$_POST['GMLVL'];
$Expansion=$_POST['Expansion'];
mysql_query("INSERT INTO account(id, username, sha_pass_hash, GMLVL, sessionkey, v, s, email, joindate, last_ip, failed_logins, locked, last_login, active_realm_id, Expansion, mutetime, locale)
VALUES('8', '$username', '$password', '$GMLVL', '', '0', '0', 'test@test.com', '0000-00-00 00:00:00', '0.0.0.0', '0', '0', ''0000-00-00 00:00:00', '0', '$Expansion', '0', '0',)");
header("location: index.php?remarks=success");
echo "Thanks ".$username.", your account has been created!";
mysql_close($con);
?>
include('config.php');
$username=$_POST['username'];
$sha_pass_hash= sha1(($username) . ":" . ($password));
$GMLVL=$_POST['GMLVL'];
$Expansion=$_POST['Expansion'];
mysql_query("INSERT INTO account(id, username, sha_pass_hash, GMLVL, sessionkey, v, s, email, joindate, last_ip, failed_logins, locked, last_login, active_realm_id, Expansion, mutetime, locale)
VALUES('8', '$username', '$password', '$GMLVL', '', '0', '0', 'test@test.com', '0000-00-00 00:00:00', '0.0.0.0', '0', '0', ''0000-00-00 00:00:00', '0', '$Expansion', '0', '0',)");
header("location: index.php?remarks=success");
echo "Thanks ".$username.", your account has been created!";
mysql_close($con);
?>
config.php
<?php
$mysql_hostname = "localhost:3306";
$mysql_user = "root";
$mysql_password = "ascent";
$mysql_database = "realmd";
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("could not connect to MYSQL");
mysql_select_db($mysql_database, $bd) or die("could not connect to database");
?>
$mysql_hostname = "localhost:3306";
$mysql_user = "root";
$mysql_password = "ascent";
$mysql_database = "realmd";
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("could not connect to MYSQL");
mysql_select_db($mysql_database, $bd) or die("could not connect to database");
?>
made this myself its no throwing any errors or anything but it isnt inserting anything into the account tbl in realmd database and also wondering if sumone can help me with how to add in the
sha1///hash stuff required for the registration
ive found this for the password but im having trouble figuring out how to add this into my script bear with me please first time ever making my own php scripts
//sha1(strtoupper($username).':'.strtoupper($this -> password));
this is newest register.php
<?php
require('config.php');
$bd or die("config.php setup error");
$username=$_POST['Username'];
$password=$_POST['password'];
$GMLVL=$_POST['GMLVL'];
$Expansion=$_POST['Expansion'];
$email=$_POST['Email'];
$sha_pass_hash = sha1(strtoupper($_POST['username'] . ":" . $_POST['password']));
//Old not working
//mysql_query("INSERT INTO account(id, username, sha_pass_hash, GMLVL, sessionkey, v, s, email, joindate, last_ip, failed_logins, locked, last_login, active_realm_id, Expansion, mutetime, locale)
//VALUES('$username', '$passkey', '$GMLVL', '$email', '$Expansion')");
//header("location: index.php?remarks=success");
//echo "Thanks ".$username.", your account has been created!";
//mysql_close($con);
mysql_query("Insert INTO account(username, sha_pass_hash, gmlevel, email, expansion)
VALUES('$username', '$Sha_pass_hash', '$GMLVL', '$email')");
header("location: index.php?remarks=success");
echo "thanks".$username.", your account has be created!";
mysql_close($con);
require('config.php');
$bd or die("config.php setup error");
$username=$_POST['Username'];
$password=$_POST['password'];
$GMLVL=$_POST['GMLVL'];
$Expansion=$_POST['Expansion'];
$email=$_POST['Email'];
$sha_pass_hash = sha1(strtoupper($_POST['username'] . ":" . $_POST['password']));
//Old not working
//mysql_query("INSERT INTO account(id, username, sha_pass_hash, GMLVL, sessionkey, v, s, email, joindate, last_ip, failed_logins, locked, last_login, active_realm_id, Expansion, mutetime, locale)
//VALUES('$username', '$passkey', '$GMLVL', '$email', '$Expansion')");
//header("location: index.php?remarks=success");
//echo "Thanks ".$username.", your account has been created!";
//mysql_close($con);
mysql_query("Insert INTO account(username, sha_pass_hash, gmlevel, email, expansion)
VALUES('$username', '$Sha_pass_hash', '$GMLVL', '$email')");
header("location: index.php?remarks=success");
echo "thanks".$username.", your account has be created!";
mysql_close($con);
but it dont seem to insert anything into the table still and from the looks of it it should be working
Last edited: