Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Help] Add extra drop down box in registration

Status
Not open for further replies.
Newbie Spellweaver
Joined
Jun 29, 2008
Messages
63
Reaction score
0
Every time I try and add a drop down box to the registration page it buggers the form up and says i need to check the accept terms box when it was checked.

Anyone know how to solve this??
 

byo

Newbie Spellweaver
Joined
Mar 18, 2004
Messages
81
Reaction score
0
if u dont show ur reg code, how did u expect us to help u :S?

it could be A LOT of reasons.
 
Elite Diviner
Loyal Member
Joined
Nov 20, 2006
Messages
462
Reaction score
1
umm... if you are using it in my files i highly dont recommand you doing that using a program...

you will need to edit things by hand to hand coding... because programs are pretty stupid when it comes to PHP...


you can post the file and what drop down menu you want me to edit and i will do it...
 
Elite Diviner
Loyal Member
Joined
Nov 20, 2006
Messages
462
Reaction score
1
never used it ...

*hint*
when your editing a table, make sure you go back to the code and check that its in the proper format
 
Newbie Spellweaver
Joined
Jun 29, 2008
Messages
63
Reaction score
0
Code:
<!doctype html PUBLIC "-//W3C//DTD XHTML 1.0 Strict //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>

<head>
<meta http-equiv="Content-Language" content="en-gb">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
<title>RageOnline PVP Svr</title>
<link rel="stylesheet" type="text/css" href="css/styles.css">
<link rel="stylesheet" type="text/css" href="css/about.css">
<script src="../scripts/functions.js" type="text/javascript"></script>
<script language="JavaScript" src="../scripts/tw-sack.js"></script>
<script language="JavaScript" src="../scripts/registration.js"></script>
<style type="text/css">
<!--
.style3 {
	color: #FFFF00;
	font-weight: bold;
	font-size: medium;
}
.style5 {font-size: small}
-->
</style>
</head>

</head>

<body>

<div id="main">
  <div id="rightmenu" class="rightmenu_register">
    <div id="content" align="justify">
      <div id="text1" style="width: 632; height: 116">
        <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="522">
          <tr>
            <td width="215"> </td>
            <td width="202"> </td>
            <td width="101"><a href="login.php">:: Menu ::</a> <br>
            Register</td>
          </tr>
        </table>
        <p>In order to play you only have to enter a <strong>username</strong>, 
        a <strong>password</strong> and an <strong>E-Mail address</strong> and
        <strong>proceed to read the terms and conditions</strong> before 
        activating the check box about your agreement to them.</div>
      <div id="register_container">
        <form name="registerForm" method="POST" action onsubmit="changeAction('register');">
          <table width="445" align="center">
            <tr>
              <td class="c" width="435" colspan="2">
              <div align="center" class="style3">
                * Registration Form *
              </div>
              </td>
            </tr>
            <tr>
              <th width="162"><span class="style5">Username:</span></th>
              <th width="137">
              <input name="character" type="text" class="style5" onkeypress="
     if (event.keyCode==60 || event.keyCode==62) event.returnValue = false;
     if (event.which==60 || event.which==62) return false;" size="20" maxlength="20" /></th>
            </tr>
            <tr>
              <th width="162"><span class="style5">Password:</span></th>
              <th width="137">
              <input name="passwrd" type="password" class="style5" onkeypress="
     if (event.keyCode==60 || event.keyCode==62) event.returnValue = false;
     if (event.which==60 || event.which==62) return false;" size="20" maxlength="20" /></th>
            </tr>
            <tr>
              <th width="162"><span class="style5">E-Mail:</span></th>
              <th width="137">
              <input name="email" type="text" class="style5" onkeypress="
     if (event.keyCode==60 || event.keyCode==62) event.returnValue = false;
     if (event.which==60 || event.which==62) return false;" size="20" maxlength="40" /></th>
            </tr>
            <tr>
              <th width="162"><span class="style5">Planet Name: </span></th>
              <th width="137">
              <input name="planet" type="text" class="style5" onkeypress="
     if (event.keyCode==60 || event.keyCode==62) event.returnValue = false;
     if (event.which==60 || event.which==62) return false;" size="20" maxlength="20" />
              </th>
            </tr>
            <tr>
              <th width="162"><span class="style5">Sex:</span></th>
              <th width="137"><span class="style5"><select name="sex">
              <option value="M" selected="selected">{Male}</option>
              <option value="F">{Female}</option>
              </select> </span></th>
            </tr>
            <tr>
              <th width="162"><span class="style5">Language:</span></th>
              <th width="137"><span class="style5"><select name="langer0">
              <option value="en" selected="selected">English</option>
              </select> </span></th>
            	</tr>
            <tr>
              <th width="162"><span class="style5">Race:</span></th>
              <th width="137"><span class="style5"><select name="race">
              <option value="amarr">amarr</option>
				<option value="caldari">caldari</option>
				<option value="gallente">gallente</option>
				<option value="minmatar">minmatar</option>
              </select> </span></th>
            </tr>
            <tr>
              <th width="162"><img src="captcha.php" /></th>
              <th width="137">
              <input name="captcha" type="text" class="style5" size="20" maxlength="20" /></th>
            </tr>
            <tr>
              <th width="162"><span class="style5">
              <input name="rgt" type="checkbox" value="ON" />
              <a href="terms.htm">Accept</a></span></th>
              <th width="137">
              <input name="submit" type="submit" class="style5" value="Register" /></th>
            </tr>
          </table>
        </form>
      </div>
      <div id="infotext">
      </div>
      <div id="statustext">
      </div>
      <td colspan="2"><center>
      <p></p>
      </center>
    </div>
  </div>
</div>

</body>

</html>

</html>
 
Newbie Spellweaver
Joined
Jun 29, 2008
Messages
63
Reaction score
0
Code:
<?php



define('INSIDE'  , true);
define('INSTALL' , false);

$ugamela_root_path = './';
include($ugamela_root_path . 'extension.inc');
include($ugamela_root_path . 'common.' . $phpEx);

includeLang('reg');

$wylosuj = rand(100000,9000000); 
$kod = md5($wylosuj);
function sendpassemail($emailaddress, $password) {
	global $lang, $kod;

	$parse['gameurl']  = GAMEURL;
	$parse['password'] = $password;
	$parse['kod']      = $kod;
	$email             = parsetemplate($lang['mail_welcome'], $parse);
	$status            = mymail($emailaddress, $lang['mail_title'], $email);
	return $status;
}

function mymail($to, $title, $body, $from = '') {
	$from = trim($from);

	if (!$from) {
		$from = ADMINEMAIL;
	}

	$rp     = ADMINEMAIL;

	$head   = '';
	$head  .= "Content-Type: text/plain \r\n";
	$head  .= "Date: " . date('r') . " \r\n";
	$head  .= "Return-Path: $rp \r\n";
	$head  .= "From: $from \r\n";
	$head  .= "Sender: $from \r\n";
	$head  .= "Reply-To: $from \r\n";
	$head  .= "Organization: $org \r\n";
	$head  .= "X-Sender: $from \r\n";
	$head  .= "X-Priority: 3 \r\n";
	$body   = str_replace("\r\n", "\n", $body);
	$body   = str_replace("\n", "\r\n", $body);

	return mail($to, $title, $body, $head);
}

if ($_POST) {
	$errors    = 0;
	$errorlist = "";

	$_POST['email'] = strip_tags($_POST['email']);
	if (!is_email($_POST['email'])) {
		$errorlist .= "\"" . $_POST['email'] . "\" " . $lang['error_mail'];
		$errors++;
	}

	session_start(); 
		$girilen = $_REQUEST["captcha"]; 
	if($_SESSION['captcha'] == $girilen){ 
		echo ""; 
	}else{ 
		$errorlist .= $lang['error_captcha']; 
		$errors++;    
	}

	if (!$_POST['planet']) {
		$errorlist .= $lang['error_planet'];
		$errors++;
	}

	if (preg_match("/[^A-z0-9_\-]/", $_POST['hplanet']) == 1) {
		$errorlist .= $lang['error_planetnum'];
		$errors++;
	}

	if (!$_POST['character']) {
		$errorlist .= $lang['error_character'];
		$errors++;
	}

	if (strlen($_POST['passwrd']) < 4) {
		$errorlist .= $lang['error_password'];
		$errors++;
	}

	if (preg_match("/[^A-z0-9_\-]/", $_POST['character']) == 1) {
		$errorlist .= $lang['error_charalpha'];
		$errors++;
	}

	if ($_POST['rgt'] != 'on') {
		$errorlist .= $lang['error_rgt'];
		$errors++;
	}

	// Le meilleur moyen de voir si un nom d'utilisateur est pris c'est d'essayer de l'appeler !!
	$ExistUser = doquery("SELECT `username` FROM {{table}} WHERE `username` = '". mysql_escape_string($_POST['character']) ."' LIMIT 1;", 'users', true);
	if ($ExistUser) {
		$errorlist .= $lang['error_userexist'];
		$errors++;
	}

	// Si l'on verifiait que l'adresse email n'existe pas encore ???
	$ExistMail = doquery("SELECT `email` FROM {{table}} WHERE `email` = '". mysql_escape_string($_POST['email']) ."' LIMIT 1;", 'users', true);
	if ($ExistMail) {
		$errorlist .= $lang['error_emailexist'];
		$errors++;
	}

	if ($_POST['sex'] != ''  &&
		$_POST['sex'] != 'F' &&
		$_POST['sex'] != 'M') {
		$errorlist .= $lang['error_sex'];
		$errors++;
	}

	if ($_POST['langer'] != ''  &&
		$_POST['langer'] != 'pl' &&
		$_POST['langer'] != 'fr' &&
		$_POST['langer'] != 'es' &&
		$_POST['langer'] != 'de' &&
		$_POST['langer'] != 'en' &&
		$_POST['langer'] != 'it') {
		$errorlist .= $lang['error_lang'];
		$errors++;
	}

	if ($_POST['race'] != ''  &&
		$_POST['race'] != 'amarr' &&
		$_POST['race'] != 'caldari' &&
		$_POST['race'] != 'gallente' &&
		$_POST['race'] != 'minmatar') {
		$errorlist .= $lang['error_race'];
		$errors++;
	}


	if ($errors != 0) {
		message ($errorlist, $lang['Register']);
	} else {
		$newpass        = $_POST['passwrd'];
		$UserName       = CheckInputStrings ( $_POST['character'] );
		$UserEmail      = CheckInputStrings ( $_POST['email'] );
		$UserPlanet     = CheckInputStrings ( $_POST['planet'] );
		

		$md5newpass     = md5($newpass);
		$Killer = $game_config['aktywacjen'];
		$killers = md5($Killer);
		$aktywacja = time()+2678400;
		// Creation de l'utilisateur
		$QryInsertUser  = "INSERT INTO {{table}} SET ";
		$QryInsertUser .= "`username` = '". mysql_escape_string(strip_tags( $UserName )) ."', ";
		$QryInsertUser .= "`email` = '".    mysql_escape_string( $UserEmail )            ."', ";
		$QryInsertUser .= "`email_2` = '".  mysql_escape_string( $UserEmail )            ."', ";
		$QryInsertUser .= "`lang` = '".     mysql_escape_string( $_POST['langer'] )      ."', ";
		$QryInsertUser .= "`sex` = '".      mysql_escape_string( $_POST['sex'] )         ."', ";
		$QryInsertUser .= "`race` = '".     mysql_escape_string( $_POST['race'] )        ."', ";
		$QryInsertUser .= "`id_planet` = '0', ";
		$QryInsertUser .= "`register_time` = '". time() ."', ";
		$QryInsertUser .= "`password`='". $md5newpass ."', ";
		$QryInsertUser .= "`aktywnosc` = '1', ";
		$QryInsertUser .= "`kod_aktywujacy`='". mysql_escape_string( $kod )              ."', ";
		$QryInsertUser .= "`kiler`='".          mysql_escape_string( $killers )          ."', ";
		$QryInsertUser .= "`time_aktyw`='".     mysql_escape_string( $aktywacja )        ."';";
		doquery( $QryInsertUser, 'users');

		// On cherche le numero d'enregistrement de l'utilisateur fraichement créé
		$NewUser        = doquery("SELECT `id` FROM {{table}} WHERE `username` = '". mysql_escape_string($_POST['character']) ."' LIMIT 1;", 'users', true);
		$iduser         = $NewUser['id'];

		// Recherche d'une place libre !
		$LastSettedGalaxyPos  = $game_config['LastSettedGalaxyPos'];
		$LastSettedSystemPos  = $game_config['LastSettedSystemPos'];
		$LastSettedPlanetPos  = $game_config['LastSettedPlanetPos'];
		while (!isset($newpos_checked)) {
			for ($Galaxy = $LastSettedGalaxyPos; $Galaxy <= MAX_GALAXY_IN_WORLD; $Galaxy++) {
				for ($System = $LastSettedSystemPos; $System <= MAX_SYSTEM_IN_GALAXY; $System++) {
					for ($Posit = $LastSettedPlanetPos; $Posit <= 4; $Posit++) {
						$Planet = round (rand ( 4, 12) );

						switch ($LastSettedPlanetPos) {
							case 1:
								$LastSettedPlanetPos += 1;
								break;
							case 2:
								$LastSettedPlanetPos += 1;
								break;
							case 3:
								if ($LastSettedSystemPos == MAX_SYSTEM_IN_GALAXY) {
									$LastSettedGalaxyPos += 1;
									$LastSettedSystemPos  = 1;
									$LastSettedPlanetPos  = 1;
									break;
								} else {
									$LastSettedPlanetPos  = 1;
								}
								$LastSettedSystemPos += 1;
								break;
						}
						break;
					}
					break;
				}
				break;
			}

			$QrySelectGalaxy  =	"SELECT * ";
			$QrySelectGalaxy .= "FROM {{table}} ";
			$QrySelectGalaxy .= "WHERE ";
			$QrySelectGalaxy .= "`galaxy` = '". $Galaxy ."' AND ";
			$QrySelectGalaxy .= "`system` = '". $System ."' AND ";
			$QrySelectGalaxy .= "`planet` = '". $Planet ."' ";
			$QrySelectGalaxy .= "LIMIT 1;";
			$GalaxyRow = doquery( $QrySelectGalaxy, 'galaxy', true);

			if ($GalaxyRow["id_planet"] == "0") {
				$newpos_checked = true;
			}

			if (!$GalaxyRow) {
				CreateOnePlanetRecord ($Galaxy, $System, $Planet, $NewUser['id'], $UserPlanet, true);
				$newpos_checked = true;
			}
			if ($newpos_checked) {
				doquery("UPDATE {{table}} SET `config_value` = '". $LastSettedGalaxyPos ."' WHERE `config_name` = 'LastSettedGalaxyPos';", 'config');
				doquery("UPDATE {{table}} SET `config_value` = '". $LastSettedSystemPos ."' WHERE `config_name` = 'LastSettedSystemPos';", 'config');
				doquery("UPDATE {{table}} SET `config_value` = '". $LastSettedPlanetPos ."' WHERE `config_name` = 'LastSettedPlanetPos';", 'config');
			}
		}
		// Recherche de la reference de la nouvelle planete (qui est unique normalement !
		$PlanetID = doquery("SELECT `id` FROM {{table}} WHERE `id_owner` = '". $NewUser['id'] ."' LIMIT 1;", 'planets', true);

		// Mise a jour de l'enregistrement utilisateur avec les infos de sa planete mere
		$QryUpdateUser  = "UPDATE {{table}} SET ";
		$QryUpdateUser .= "`id_planet` = '". $PlanetID['id'] ."', ";
		$QryUpdateUser .= "`current_planet` = '". $PlanetID['id'] ."', ";
		$QryUpdateUser .= "`galaxy` = '". $Galaxy ."', ";
		$QryUpdateUser .= "`system` = '". $System ."', ";
		$QryUpdateUser .= "`planet` = '". $Planet ."' ";
		$QryUpdateUser .= "WHERE ";
		$QryUpdateUser .= "`id` = '". $NewUser['id'] ."' ";
		$QryUpdateUser .= "LIMIT 1;";
		doquery( $QryUpdateUser, 'users');

		// Mise a jour du nombre de joueurs inscripts
		doquery("UPDATE {{table}} SET `config_value` = `config_value` + '1' WHERE `config_name` = 'users_amount' LIMIT 1;", 'config');
		doquery("UPDATE {{table}} SET `config_value` = `config_value` + '1' WHERE `config_name` = 'aktywacjen' LIMIT 1;", 'config');

		$Message  = $lang['thanksforregistry'];
		if (sendpassemail($_POST['email'], "$newpass")) {
			$Message .= " (" . htmlentities($_POST["email"]) . ")";
		} else {
			$Message .= " (" . htmlentities($_POST["email"]) . ")";
			$Message .= "<br><br>". $lang['error_mailsend'] ." <b>" . $newpass . "</b>";
		}
		message( $Message, $lang['reg_welldone']);
	}
} else {
	// Afficher le formulaire d'enregistrement
	$parse               = $lang;
	$parse['servername'] = $game_config['game_name'];

	display(parsetemplate(gettemplate('registry_form'), $parse), $lang['registry'], false);
}

// -----------------------------------------------------------------------------------------------------------
// History version
// 1.0 - Version originelle
// 1.1 - Menage + rangement + utilisation fonction de creation planete nouvelle generation
?>
 

byo

Newbie Spellweaver
Joined
Mar 18, 2004
Messages
81
Reaction score
0
Well ... i think if u cant see it by urself, is because u r tired of looking around.

The problem is :
Code:
if ($_POST['rgt'] != 'on') {

The rgt form field value is: "ON" not "on"

Uppercase, lowercase, that stuff, did u get it ?
 
Elite Diviner
Loyal Member
Joined
Nov 20, 2006
Messages
462
Reaction score
1
okay... at this moment, im not sure wtf are you doing really... get a fresh copy of my reg system and here is the only thing you need to know

This Code, add it after </tr>
PHP:
<tr>
                        <th><span class="style5">Uh? Table?:</span></th>
                        <th><span class="style5">
                          <select name="your table name">
                            <option value="your choice description" selected="your table option"></option>
                             <option value="Hello" selected="TheHelloOption!"></option> 
                        </select>
                        </span></th>
                      </tr>

there... i told you, all i need is to tell me what you want me to add and i will make it
 
Elite Diviner
Loyal Member
Joined
Nov 20, 2006
Messages
462
Reaction score
1
and i see that you added a race table "wrong way of course" but anyways here is the right thing to do

PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"><title>RageOnline PVP Svr</title>

<link rel="stylesheet" type="text/css" href="css/styles.css">
<link rel="stylesheet" type="text/css" href="css/about.css">
<script src="../scripts/functions.js" type="text/javascript"></script>
<script language="JavaScript" src="../scripts/tw-sack.js"></script>
<script language="JavaScript" src="../scripts/registration.js"></script>
<style type="text/css">
<!--
.style3 {
	color: #FFFF00;
	font-weight: bold;
	font-size: medium;
}
.style5 {font-size: small}
-->
</style>
</head><body>
<a href="#pustekuchen" style="display: none;">Loginlink</a>

<div id="main">
<div id="mainmenu">
    <a href="login.php">:: Menu ::</a>
    <div class="menupoint">Register!</div>
</div>

    <div id="rightmenu" class="rightmenu_register">
        <div id="title">Registration</div>
        <div id="content"  align="justify">
            <div id="text1">In order to play you only have to enter a <strong>username</strong>, a <strong>password</strong> and an <strong>E-Mail address</strong> and <strong>proceed to read the terms and conditions</strong> before activating the check box about your agreement to them.</div>

            
            <div id="register_container">
                <form name="registerForm"  method="POST" action="" onsubmit="changeAction('register');" >
                  <table width="340" align="center">
                    <tbody>
                      <tr>
                        <td colspan="2" class="c"><div align="center" class="style3">* Registry Forum * </div></td>
                      </tr>
                      <tr>
                        <th width="179"><span class="style5">Username:</span></th>
                        <th width="149"><input name="character" type="text" class="style5" onkeypress="
     if (event.keyCode==60 || event.keyCode==62) event.returnValue = false;
     if (event.which==60 || event.which==62) return false;" size="20" maxlength="20" />
                                                    </th>
                      </tr>
                      <tr>
                        <th><span class="style5">Password:</span></th>
                        <th><input name="passwrd" type="password" class="style5" onkeypress="
     if (event.keyCode==60 || event.keyCode==62) event.returnValue = false;
     if (event.which==60 || event.which==62) return false;" size="20" maxlength="20" /></th>
                      </tr>
                      <tr>
                        <th><span class="style5">E-Mail:</span></th>
                        <th><input name="email" type="text" class="style5" onkeypress="
     if (event.keyCode==60 || event.keyCode==62) event.returnValue = false;
     if (event.which==60 || event.which==62) return false;" size="20" maxlength="40" /></th>
                      </tr>
                      <tr>
                        <th><span class="style5">Planet Name: </span></th>
                        <th><input name="planet" type="text" class="style5" onkeypress="
     if (event.keyCode==60 || event.keyCode==62) event.returnValue = false;
     if (event.which==60 || event.which==62) return false;" size="20" maxlength="20" />
                                                    </th>
                      </tr>
                      <tr>
                        <th><span class="style5">Sex:</span></th>
                        <th><span class="style5">
                          <select name="sex">
                            <option value="M" selected="selected">{Male}</option>
                            <option value="F">{Female}</option>
                          </select>
                        </span></th>
                      </tr>
                      <tr>
                        <th><span class="style5">Language:</span></th>
                        <th><span class="style5">
                          <select name="langer">
                            <option value="en" selected="selected">English</option>
                              
                        </select>
                        </span></th>
                      </tr>
					  <tr>
                        <th><span class="style5">Race:</span></th>
                        <th><span class="style5">
                          <select name="Race">
			    <option value="." selected="selected">-Options-</option>
				<option value="Caldari">Caldari</option>
				<option value="Gallente">Gallente</option>
				<option value="Minmatar">Minmatar</option>
     
                          </select>
                        </span></th>
                      </tr>  
                      <tr>
                        <th><img src="captcha.php" /></th>
                        <th><input name="captcha" type="text" class="style5" size="20" maxlength="20" /></th>
                      </tr>
                      <tr>
                        <th><span class="style5">
                        <input name="rgt" type="checkbox" />
        Accept</span></th>
                        <th><input name="submit" type="submit" class="style5" value="Register Me" /></th>
                      </tr>
                    </tbody>
                  </table>
                </form>
            </div>
            <div id="infotext"></div>
            <div id="statustext"></div>

<td colspan="2"><center>
  </div>
    </div></div>
</body></html>
 

byo

Newbie Spellweaver
Joined
Mar 18, 2004
Messages
81
Reaction score
0
no hero, theres no need to delete the value of the checkbox.

only needs to modify his php part, to "ON" ...

or just verify in this way:
Code:
if(!$_POST[rgt]){
$error = "blabla";
}
 
Newbie Spellweaver
Joined
Jun 29, 2008
Messages
63
Reaction score
0
Sorry guys im new to php and havnt had any proper lessons in it. (you can probably see).

Im just trying to add a race drop down box to the registration page with four options. I thought if i just copy one of the other boxes and just rename the values that would be ok...

hero is that code you posted a working version? Not sure because byo mentions no need to delete checkbox..

do i just need to re enter the accept checkbox??
 
Elite Diviner
Loyal Member
Joined
Nov 20, 2006
Messages
462
Reaction score
1
the reg page i just posted is 100% working.. all you need is to add the table to db etc.. which is your part not mine :D
 
Elite Diviner
Loyal Member
Joined
Nov 20, 2006
Messages
462
Reaction score
1
hehe anything for you bro :)

check out the new dark matter thread!! just finished it :p
you could use it on your server too
 
Newbie Spellweaver
Joined
Nov 7, 2005
Messages
48
Reaction score
0
i was same problem,tnx for byo who show me that topic :D
ZrrY about my English
 
Last edited:
Status
Not open for further replies.
Back
Top