Hello i tryed to edit the register page written by Wizkid, to create a buy colour name script..
i created dbo.colourname 2.. but if how i make the script if people typ hes username than it comes to dbo.colourname and not to dbo.account or dbo.login i need this because there is not a script from setting urgade 1 if people buy colourname ( my ugrade 1 is donator grade ), so i if guys buy colour name than comes to dbo.colourname than i can send they colourgrade! here is the script! PLEASEE HELP: green.gunz@hotmail.com @!!@@
<?php
/*
Original by Wizkid,
Captcha added by Phoenix,
Completely reworked by Aaron (zyberscape) with LegacyGamers.net
*/
$dns="GreenGunzDB";
$user="sa";
$pass="************";
$connect = odbc_connect($dns, $user, $pass) or die ("Couldn't connect to the database...");
$select_db = odbc_exec($connect, "use GunzDB");
function cleanup($info){
$info = stripslashes($info);
$info = htmlspecialchars($info);
return $info;
}
function doesUsercolournameExist($colourname){
$exit = FALSE;
$result = @odbc_exec($connect, "SELECT UserID FROM Account WHERE UserID='".$colourname."'");
if(odbc_num_rows($result) != 0){
$exit = TRUE;
}
else{
$exit = FALSE;
}
return $exit;
}
if(isset($_POST['register'])){
$securimage = new Securimage();
if(empty($_POST['usercolourname']) || strlen($_POST['usercolourname']) > 25){ //reasonable
$errormsg.="No usercolourname filled or too long.<br>";
}
if(empty($_POST['colourname']) || strlen($_POST['colourname']) > 50){ //again set a resonable limit..
$errormsg.="No colourname filled or colourname is FAR too long.<br>";
}
//
if(!empty($errormsg)){
echo "<div>There were some problems with buying colour name:<br>".$errormsg."</div>";
exit();
}
else {
$usercl = cleanup($_POST['usercolourname']);
$colournamecl = cleanup($_POST['colourcolourname']);
if(doesUsercolournameExist($usercl)){ //username is taken
echo "<div style=\"font-weight: bold;\">Only Yellow colourname.</div>";
exit();
}
else {
$insert_account = odbc_exec($connect, "INSERT INTO Account (UserID, UGradeID, PGradeID, RegDate, Email, Age, colourname) VALUES ('".$usercl."', '0', '0', '".date("Y-m-d H:i:s")."', '".$_POST['email']."', '".$_POST['age']."', '".$colournamecl."')");
$get_aid = odbc_fetch_array(odbc_exec($connect, "SELECT AID FROM Account WHERE UserID='".$usercl."'"));
$inster_login = odbc_exec($connect, "INSERT INTO Login (UserID, AID, Password) VALUES ('".$usercl."', '".$get_aid['AID']."', '".$colournamecl."')");
echo '<div align="center">Your account is succesfully created with the colourname '.$usercl.'!</div>';
exit();
}
}
}
?>
<!DOCTYPE html>
<head>
<title>Green Gunz Buying Colour Name</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div style="font-weight:bold;">You can buy a colour name right heree:<br></div>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
<table>
<tr>
<td>Username</td>
<td><input type="text" username="username" maxlength="25" /></td>
</tr>
<tr>
<td>Colour: Yellow</td>
</tr>
<tr>
<td width="434" colspan="2"><hr color="#323232" width="96%"></td>
</tr>
<tr>
<td align="center" colspan="2"><input type="submit" colourname="register" value="Buy Colourcolourname!" /></td>
</tr>
</table>
</form>
</body>
</html>
<SCRIPT language="JavaScript">
<!--
//Disable right click script
var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
// -->
</SCRIPT>
<META HTTP-EQUIV="imagetoolbar" CONTENT="no">
PLEASE HELP, sorry for bad english![]()




Reply With Quote


