• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved [PHP] (T_CASE) Error

HappyFeet

New Member
Joined
Nov 8, 2012
Messages
244
Reaction score
3
Location
Netherlands
I'm getting this error and I cant figure out where it come from.

Parse error
: syntax error, unexpected 'case' (T_CASE) in D:\xampp\htdocs\x\account.php on line 456
PHP:
break;

#####CHANGE PASSWORD#####
case "password":                 <--------- Line 456
if ((!isset($acc_logged) && isset($pass_logged) && $acc_logged != null && $acc_logged != "" && $pass_logged != null && $pass_logged != ""))
header("Location: index.php");
else {

 

Tarek1337

Legendary OT User
Joined
Jun 9, 2012
Messages
3,587
Solutions
3
Reaction score
1,167
Location
Sweden
I'm getting this error and I cant figure out where it come from.

Parse error
: syntax error, unexpected 'case' (T_CASE) in D:\xampp\htdocs\x\account.php on line 456
PHP:
break;

#####CHANGE PASSWORD#####
case "password":                 <--------- Line 456
if ((!isset($acc_logged) && isset($pass_logged) && $acc_logged != null && $acc_logged != "" && $pass_logged != null && $pass_logged != ""))
header("Location: index.php");
else {
is this GesiorAAC2009?
 

Okke

Voidcore 7.4
Joined
Jul 19, 2015
Messages
1,011
Solutions
23
Reaction score
616
Location
germany
Znote will work on 0.6.3+ I think.

I suggest you to move from SVN to TFS 0.4, most of your scripts will be compatible and its performance is way better.
 

Znote

<?php echo $title; ?>
Staff member
Global Moderator
Premium User
Joined
Feb 14, 2008
Messages
6,913
Solutions
248
Reaction score
1,833
Location
Norway
GitHub
Znote
Znote AAC does not officially support OTserv 0.6.3 due to slightly different SQL queries.
However I have seen an unofficial version of Znote AAC being used that supports Avesta, which I believe is based on something between OTserv 0.6.0 - 0.6.3.

I'm getting this error and I cant figure out where it come from.

Parse error: syntax error, unexpected 'case' (T_CASE) in D:\xampp\htdocs\x\account.php on line 456
PHP:
break;

#####CHANGE PASSWORD#####
case "password":                 <--------- Line 456
if ((!isset($acc_logged) && isset($pass_logged) && $acc_logged != null && $acc_logged != "" && $pass_logged != null && $pass_logged != ""))
header("Location: index.php");
else {

Perhaps you are missing the switch statement?
 
OP
OP
HappyFeet

HappyFeet

New Member
Joined
Nov 8, 2012
Messages
244
Reaction score
3
Location
Netherlands
the problem is in this part
PHP:
if (isset($acc_logged) && isset($pass_logged) && $acc_logged != "" && $pass_logged != "") {

            if ($acc_logged == "111111" || $acc_logged == "1") {
                echo "<h1>Error!</h1><p>Due to safetey reasons this account number is blocked!</p><br />";
                $error = 1;
            }

            if (strlen($acc_logged) < 6 || strlen($acc_logged) > 8 || strlen($pass_logged) < 3 || strlen($rlname) > 17 || strlen($location) > 25 || strlen($mail) > 40) {
                echo "<h1>Error!</h1><p>Please fill out the form correctly!</p>";
                $error = 1;
                } else if (!is_numeric($acc_logged)) {
                    echo "<h1>Error!</h1><p>Your account number must consist of 6 to 8 digits!</p>";
                    $error = 1;
                    } else {

                        $temp = strspn("$pass_logged", "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890 ");

                        if ($temp != strlen($pass_logged)) {
                            echo "<h1>Error!</h1><p>Your password must consist of more then 2 letters or numbers (ABC, abc, 123 and blankspaces)!</p>";
                            $error = 1;
                            } else {


                                if ($rlname == '') {
                                    echo "<h1>Error!</h1><p>Please fill your real life name due to safety reasons.</p>";
                                    $error = 1;
                                    } else {
                                        if ($location == '') {
                                            echo "<h1>Error!</h1><p>Please fill in your location due to safety reasons.</p>";
                                            $error = 1;
                                            } else {
                                                if ($mail == '') {
                                                    echo "<h1>Error!</h1><p>Please fill your email adress due to safety reasons.</p>";
                                                    $error = 1;
                                                    } else {



                                                        if ($error == 0) {

                                                            $query = mysqli_query('SELECT * FROM accounts WHERE (accno = '.$acc_logged.')');
                                                            if (mysqli_num_rows($query) != 0) {
                                                                echo("<h1>Error!</h1><p>This account number already exist. Please go <a href=\"account.php?page=register\">back</a> and refill the form.</p>");
                                                                include ('footer.inc.php');
                                                                die;

                                                            }
                                                            //$sql = "INSERT INTO accounts(id, accno, password, type, premDays, email, blocked, rlname, location, hide, hidemail) values(NULL,'$acc_logged','$pass_logged','1','0','$mail','0', '$rlname', '$location', '$show', '$hidemail')";

                                                            $sql = "INSERT INTO accounts(id, accno, password, type, premDays, premEnd, email, blocked, rlname, location, hide, hidemail) values(NULL,'$acc_logged','$pass_logged','1','0','0','$mail','0', '$rlname', '$location', '$show', '$hidemail')";
                                                            mysqli_query($sql);

                                                            session_unset();
                                                            ?>
                                                            <h1>Congratulations!</h1><p>Your account were successfully created. Please login to create your first character.<br /></p>

                                                            <?
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
 
Last edited:
Top