Jump to content

Wrong selection


zero_ZX

Recommended Posts

Hi guys.

I wondered why this little script, doesnt put "8" into "flags" but only "0" each time.

Can any one help me out with this one?

<?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>";
}
?>

Link to comment
https://forums.phpfreaks.com/topic/96263-wrong-selection/
Share on other sites

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>";

 

The SELECT element does not have a "name" attribute

Link to comment
https://forums.phpfreaks.com/topic/96263-wrong-selection/#findComment-492778
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.