zero_ZX Posted March 14, 2008 Share Posted March 14, 2008 Well guys, i have really tried to be sorting this out, but i cant really find the place i need to edit. This sql is comined with an application. You have two options. The one would put an "8" in the row "flags" and the other would put "0" in flags. However no matter what option i use, i get an 0 in my flags, i really need your help, so ill just post the file im using. Notice the data.php only contains mysql acces, and the other included file are for further intigration with ipb. <?php <style type="text/css"> <!-- body { background-color: #212021; } a:link { color: #00FF00; } .style1 {font-weight: bold} body,td,th { color: #FFFFFF; } --> </style> <?php include('../data.php'); require_once "../ipbsdk/ipbsdk_class.inc.php"; $SDK =& new IPBSDK(); mysql_connect($server, $login, $pass) or die ("can't connect to dbase-server"); mysql_select_db($db) or die ("can't select dbase"); $name = $_POST["uname"]; $pass1 = $_POST["password"]; $pass2 = $_POST["password2"]; $mail1 = $_POST["email"]; $mail2 = $_POST["email2"]; $checked = $_POST["accept"]; if ($checked == "accept") { if ($mail1 == "") { echo "<head>"; echo "<script type='text/javascript'> function doit0(box) {if (box.selectedIndex == 0) return; alert('Are you sure you want to change this')}"; echo "</script>"; echo "</head>"; echo "<body background= ../img/newspagebackground.jpg>"; echo "<br><br><center>"; echo "<b>Please enter a mail address</b><br>"; echo "<form name='select nick' action='create.php' method='POST'>"; echo "<table border = 2>"; echo "<input name='uname' type='hidden' size=30 value=".$name.">"; echo "<tr><th>Username: </th><th>$name</th></tr>"; echo "<tr><th>Password: </th><td><input type=password name=password size=25></td></tr>"; echo "<tr><th>Confirm: </th><td><input type=password name=password2 size=25></td></tr>"; echo "<tr><th>Game Version:</th><td><SELECT id='flags' onchange='javascript:doit0(this)'><OPTION class='8' value='8'>Burning Crusade <OPTION class='1' value='0'>Normal wow</SELECT></td></tr>"; echo "<tr><th bgcolor= red>Email: </th><td><input type=text name=email size=25></td></tr>"; echo "<tr><th bgcolor= red>Confirm: </th><td><input type=text name=email2 size=25></td></tr>"; echo "<tr><th colspan=2>I have read and accept the <a href='".$htmlstuff."disclamer.php'> disclamer</a> and the <a href='".$htmlstuff."rules.php'>server rules</a></th></tr>"; echo "<tr><th colspan=2><input type=checkbox name=accept value=accept></th></tr>"; echo "<tr><th colspan=2><input type='submit' name='check' value='Create account'></th></tr>"; echo "</form>"; echo "</table>"; echo "</center>"; echo "</body>"; } else { if ($mail1 == $mail2) { if ($pass1 == "") { echo "<head>"; echo "<script type='text/javascript'> function doit0(box) {if (box.selectedIndex == 0) return; alert('Are you sure you want to change this')}"; echo "</script>"; echo "</head>"; echo "<body background= ../img/newspagebackground.jpg>"; echo "<br><br><center>"; echo "<b>Please enter a password</b><br>"; echo "<form name='select nick' action='create.php' method='POST'>"; echo "<table border = 2>"; echo "<input name='uname' type='hidden' size=30 value=".$name.">"; echo "<tr><th>Username: </th><th>$name</th></tr>"; echo "<tr><th bgcolor=red>Password: </th><td><input type=password name=password size=25></td></tr>"; echo "<tr><th bgcolor=red>Confirm: </th><td><input type=password name=password2 size=25></td></tr>"; echo "<tr><th>Email: </th><td><input type=text name=email size=25 value=".$mail1."></td></tr>"; echo "<tr><th>Confirm: </th><td><input type=text name=email2 size=25 value=".$mail2."></td></tr>"; echo "<tr><th>Game Version:</th><td><SELECT id='flags' onchange='javascript:doit0(this)'><OPTION class='8' value='8'>Burning Crusade <OPTION class='1' value='0'>Normal wow</SELECT></td></tr>"; echo "<tr><th colspan=2>I have read and accept the <a href='".$htmlstuff."disclamer.php'> disclamer</a> and the <a href='".$htmlstuff."rules.php'>server rules</a></th></tr>"; echo "<tr><th colspan=2><input type=checkbox name=accept value=accept></th></tr>"; echo "<tr><th colspan=2><input type='submit' name='check' value='Create account'></th></tr>"; echo "</form>"; echo "</table>"; echo "</center>"; echo "</body>"; } else { if ($pass1 == $pass2) { mysql_connect ($server, $login, $pass) or die ("can't connect to the game server "); mysql_select_db($db); if ($uid = $SDK->create_account($name, $pass1, $mail1,array(),false,$name)) { $sql= "INSERT INTO accounts (login, password, email, flags)VALUES('$name', '$pass1', '$mail1', '$flags' )"; if (!mysql_query($sql)) { die('Oeps: ' . mysql_error()); } else { echo "Everything seems to be ok, You can now log on to the server and forum."; echo "You are now redirected to the newspage"; include "redirect.php"; } } else { echo '<font color=red><strong>Error:</strong> The Registration Failed: '.$SDK->sdk_error().'</font>'; echo "<head>"; echo "<script type='text/javascript'> function doit0(box) {if (box.selectedIndex == 0) return; alert('Are you sure you want to change this')}"; echo "</script>"; echo "</head>"; echo "<body background= ../img/newspagebackground.jpg>"; echo "<br><br><center>"; echo "<b>Please enter a password</b><br>"; echo "<form name='select nick' action='create.php' method='POST'>"; echo "<table border = 2>"; echo "<input name='uname' type='hidden' size=30 value=".$name.">"; echo "<tr><th>Username: </th><th>$name</th></tr>"; echo "<tr><th bgcolor=red>Password: </th><td><input type=password name=password size=25></td></tr>"; echo "<tr><th bgcolor=red>Confirm: </th><td><input type=password name=password2 size=25></td></tr>"; echo "<tr><th>Email: </th><td><input type=text name=email size=25 value=".$mail1."></td></tr>"; echo "<tr><th>Confirm: </th><td><input type=text name=email2 size=25 value=".$mail2."></td></tr>"; echo "<tr><th>Game Version:</th><td><SELECT id='flags' onchange='javascript:doit0(this)'><OPTION class='8' value='8'>Burning Crusade <OPTION class='1' value='0'>Normal wow</SELECT></td></tr>"; echo "<tr><th colspan=2>I have read and accept the <a href='".$htmlstuff."disclamer.php'> disclamer</a> and the <a href='".$htmlstuff."rules.php'>server rules</a></th></tr>"; echo "<tr><th colspan=2><input type=checkbox name=accept value=accept></th></tr>"; echo "<tr><th colspan=2><input type='submit' name='check' value='Create account'></th></tr>"; echo "</form>"; echo "</table>"; echo "</center>"; echo "</body>"; } } else { echo "<head>"; echo "<script type='text/javascript'> function doit0(box) {if (box.selectedIndex == 0) return; alert('Are you sure you want to change this')}"; echo "</script>"; echo "</head>"; echo "<body background= ../img/newspagebackground.jpg>"; echo "<br><br><center>"; echo "<b>passwords don't match</b><br>"; echo "<form name='select nick' action='create.php' method='POST'>"; echo "<table border = 2>"; echo "<input name='uname' type='hidden' size=30 value=".$name.">"; echo "<tr><th>Username: </th><th>$name</th></tr>"; echo "<tr><th bgcolor=red>Password: </th><td><input type=password name=password size=25></td></tr>"; echo "<tr><th bgcolor=red>Confirm: </th><td><input type=password name=password2 size=25></td></tr>"; echo "<tr><th>Email: </th><td><input type=text name=email size=25 value=".$mail1."></td></tr>"; echo "<tr><th>Confirm: </th><td><input type=text name=email2 size=25 value=".$mail2."></td></tr>"; echo "<tr><th>Game Version:</th><td><SELECT id='flags' onchange='javascript:doit0(this)'><OPTION class='8' value='8'>Burning Crusade <OPTION class='1' value='0'>Normal wow</SELECT></td></tr>"; echo "<tr><th colspan=2>I have read and accept the <a href='".$htmlstuff."disclamer.php'> disclamer</a> and the <a href='".$htmlstuff."rules.php'>server rules</a></th></tr>"; echo "<tr><th colspan=2><input type=checkbox name=accept value=accept></th></tr>"; echo "<tr><th colspan=2><input type='submit' name='check' value='Create account'></th></tr>"; echo "</form>"; echo "</table>"; echo "</center>"; echo "</body>"; } } } else { echo "<head>"; echo "<script type='text/javascript'> function doit0(box) {if (box.selectedIndex == 0) return; alert('Are you sure you want to change this')}"; echo "</script>"; echo "</head>"; echo "<body background= ../img/newspagebackground.jpg>"; echo "<br><br><center>"; echo "<b>please enter the same email address twice</b><br>"; echo "<form name='select nick' action='create.php' method='POST'>"; echo "<table border = 2>"; echo "<input name='uname' type='hidden' size=30 value=".$name.">"; echo "<tr><th>Username: </th><th>$name</th></tr>"; echo "<tr><th>Password: </th><td><input type=password name=password size=25></td></tr>"; echo "<tr><th>Confirm: </th><td><input type=password name=password2 size=25></td></tr>"; echo "<tr><th>Game Version:</th><td><SELECT id='flags' onchange='javascript:doit0(this)'><OPTION class='8' value='8'>Burning Crusade <OPTION class='1' value='0'>Normal wow</SELECT></td></tr>"; echo "<tr><th bgcolor=red>Email: </th><td><input type=text name=email size=25 value=".$mail1."></td></tr>"; echo "<tr><th bgcolor=red>Confirm: </th><td><input type=text name=email2 size=25 value=".$mail2."></td></tr>"; echo "<tr><th colspan=2>I have read and accept the <a href='".$htmlstuff."disclamer.php'> disclamer</a> and the <a href='".$htmlstuff."rules.php'>server rules</a></th></tr>"; echo "<tr><th colspan=2><input type=checkbox name=accept value=accept></th></tr>"; echo "<tr><th colspan=2><input type='submit' name='check' value='Create account'></th></tr>"; echo "</form>"; echo "</table>"; echo "</center>"; echo "</body>"; } } } else { echo "<head>"; echo "<script type='text/javascript'> function doit0(box) {if (box.selectedIndex == 0) return; alert('Are you sure you want to change this')}"; echo "</script>"; echo "</head>"; echo "<body background= ../img/newspagebackground.jpg>"; echo "<br><br><center>"; echo "<b>If u don't accept our rules and disclamer u wont be able to create an account</b><br>"; echo "<form name='select nick' action='create.php' method='POST'>"; echo "<table border = 2>"; echo "<input name='uname' type='hidden' size=30 value=".$name.">"; echo "<tr><th>Username: </th><th>$name</th></tr>"; echo "<tr><th>Password: </th><td><input type=password name=password size=25></td></tr>"; echo "<tr><th>Confirm: </th><td><input type=password name=password2 size=25></td></tr>"; echo "<tr><th>Game Version:</th><td><SELECT id='flags' onchange='javascript:doit0(this)'><OPTION class='8' value='8'>Burning Crusade <OPTION class='1' value='0'>Normal wow</SELECT></td></tr>"; echo "<tr><th>Email: </th><td><input type=text name=email size=25></td></tr>"; echo "<tr><th>Confirm: </th><td><input type=text name=email2 size=25></td></tr>"; echo "<tr><th colspan=2>I have read and accept the <a href='".$htmlstuff."disclamer.php'> disclamer</a> and the <a href='".$htmlstuff."rules.php'>server rules</a></th></tr>"; echo "<tr><th colspan=2><font color=red>u need to accept here</font><input type=checkbox name=accept value=accept></th></tr>"; echo "<tr><th colspan=2><input type='submit' name='check' value='Create account'></th></tr>"; echo "</form>"; echo "</table>"; echo "</center>"; echo "</body>"; } ?> MOD EDIT: Use <?php ... ?> tags, not .. Link to comment https://forums.phpfreaks.com/topic/96212-wrong-selection/ Share on other sites More sharing options...
fenway Posted March 15, 2008 Share Posted March 15, 2008 Well, i never see $flags being assigned. Link to comment https://forums.phpfreaks.com/topic/96212-wrong-selection/#findComment-492983 Share on other sites More sharing options...
Barand Posted March 15, 2008 Share Posted March 15, 2008 zero, Don't waste our time by double-posting again. Link to comment https://forums.phpfreaks.com/topic/96212-wrong-selection/#findComment-492990 Share on other sites More sharing options...
Recommended Posts