Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: Error Help/

  1. #1
    Join Date
    Feb 2006
    Location
    Ontario Canada
    Posts
    4,587
    Tokens
    0

    Latest Awards:

    Default Error Help/

    I've looked over this and no idea why.
    If i login using the correct info it say's loginning in but then goes back to the form instead of showing the links..
    PHP Code:
    <?PHP



     $connection 
    mysql_connect("",
                                
    "",
                                
    "");
    mysql_select_db(""$connection);












    $id $_REQUEST['id'];
    switch(
    $id){
















    default:
    if(
    $_SESSION['zetolic_user']){
    $select mysql_query("SELECT * FROM `users` WHERE `username`='$_SESSION[zetolic_user]'");
    $fetch mysql_fetch_array($select);
    echo
    "<center><font face='verdana' size='1'>
    <b>Welcome,<a href='?page=member&id=" 
    $_SESSION[zetolic_user] . "'> $_SESSION[zetolic_user]</b></a><br>
    Current  Zoints: <b>
    $fetch[coins]</b><br><br>
    <a href='?page=function&id=trade'>Trade  Zoints</a><br>
    <a href='?page=function&id=profile'>Edit Profile</a><br>"
    ;
    if(
    $fetch[rank] == 3){
    if(
    $_SESSION[zetolic_admin]){
        echo
    "<a href='?page=admin&id=list'>UserList</a><br>
    <a href='?page=admin&id=search'>Search Users</a><br>
    "
    ;
    }
    else {
        
















    echo
    "<a href='?page=admin'>Admin Login</a><br>";
        }
    }
















    echo
    "
    <a href='?page=function&id=logout'>Logout</a>
    </font></center>"
    ;
    }
    else {
    echo
    "<center><font face='verdana' size='1'><form action='?page&id=login' method='POST'>
    Username :<br><input name='zetolic_user'><br><br>
    Password :<br><input type='password' name='zetolic_pass'><br>
    <input type='Submit' value='Login'></form><br><br>
    <a href='?page=register'>Register</a></font></center>"
    ;
















    }
















    break;
















    case 
    "login":
    $user $_POST['zetolic_user'];
    $pass md5($_POST['zetolic_pass']);
    $select mysql_query("SELECT * FROM `users` WHERE `username`='$user' AND `password`='$pass'");
    $count mysql_num_rows($select);
    if(
    $count == '0'){
    echo
    "<meta http-equiv='REFRESH' content='0;url=?'>";
    echo
    "<center><font face='verdana' size='1'>Invalid Username/Password</center></font>";
    }
    else {
    echo
    "<meta http-equiv='REFRESH' content='0;url=?'>";
    echo
    "<center><font face='verdana' size='1'>Loggining in</center></font>";
    $_SESSION['zetolic_user'] = $user;
    }
    break;
































    }

    .:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
    .:.: Stand up for what is right, even if you stand alone:.:.


  2. #2
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    I'd be happy to help you, but that coding is just too awful.. not to mention messy.. <?PHP -> <?php first off

    Try to clean it up a bit, and remove the 6 miles of whitespace.

  3. #3
    Join Date
    Nov 2005
    Posts
    4,486
    Tokens
    921

    Latest Awards:

    Default

    Horrible PHP coding.
    That is worse than mine and mine is pretty bad.
    Man, try and clean up that, or no-one will help you.
    "RETIRED" FROM HABBO(X)

    :¬:

    TOMSPIT / COWLY05


  4. #4
    Join Date
    Apr 2008
    Location
    England.
    Posts
    1,324
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    <?php
    $connection 
    mysql_connect("","","");
    mysql_select_db(""$connection);
    $id $_REQUEST['id'];
    switch(
    $id){

    default:
    if(
    $_SESSION['zetolic_user']){
    $select mysql_query("SELECT * FROM `users` WHERE `username`='$_SESSION[zetolic_user]'");
    $fetch mysql_fetch_array($select);
    echo
    "<center><font face='verdana' size='1'>
    <b>Welcome,<a href='?page=member&id=" 
    $_SESSION[zetolic_user] . "'> $_SESSION[zetolic_user]</b></a><br>
    Current  Zoints: <b>
    $fetch[coins]</b><br><br>
    <a href='?page=function&id=trade'>Trade  Zoints</a><br>
    <a href='?page=function&id=profile'>Edit Profile</a><br>"
    ;
    if(
    $fetch[rank] == 3){
    if(
    $_SESSION[zetolic_admin]){
    echo
    "<a href='?page=admin&id=list'>UserList</a><br>
    <a href='?page=admin&id=search'>Search Users</a><br>"
    ;
    }
    else {
        
    echo
    "<a href='?page=admin'>Admin Login</a><br>";

        }
    }

    echo
    " <a href='?page=function&id=logout'>Logout</a>
    </font></center>"
    ;
    }
    else {
    echo
    "<center><font face='verdana' size='1'><form action='?page&id=login' method='POST'>
    Username :<br><input name='zetolic_user'><br><br>
    Password :<br><input type='password' name='zetolic_pass'><br>
    <input type='Submit' value='Login'></form><br><br>
    <a href='?page=register'>Register</a></font></center>"
    ;

    }

    break;
    case 
    "login":
    $user $_POST['zetolic_user'];
    $pass md5($_POST['zetolic_pass']);
    $select mysql_query("SELECT * FROM `users` WHERE `username`='$user' AND `password`='$pass'");
    $count mysql_num_rows($select);
    if(
    $count == '0'){
    echo
    "<meta http-equiv='REFRESH' content='0;url=?'>";
    echo
    "<center><font face='verdana' size='1'>Invalid Username/Password</center></font>";
    }
    else {
    echo
    "<meta http-equiv='REFRESH' content='0;url=?'>";
    echo
    "<center><font face='verdana' size='1'>Loggining in</center></font>";
    $_SESSION['zetolic_user'] = $user;
    }
    break;


    ?>
    Personal preference.
    Last edited by Excellent; 17-06-2008 at 03:12 PM.

  5. #5
    Join Date
    Nov 2005
    Posts
    4,486
    Tokens
    921

    Latest Awards:

    Default

    Much cleaner =D
    "RETIRED" FROM HABBO(X)

    :¬:

    TOMSPIT / COWLY05


  6. #6
    Join Date
    Apr 2008
    Location
    England.
    Posts
    1,324
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by TomSpit View Post
    Much cleaner =D
    If the coding was better I would have spent more time cleaning it up.

  7. #7
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    I think it looks neat with capitals..

    I got some addiction now of doing Mysql_Fetch_Array(); etc

    It looks smart i think? :S

    but yeh anyway

    And you have coded it weirdly imo

  8. #8
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    That looks awful Jack

  9. #9
    Join Date
    Jun 2008
    Location
    Scotland
    Posts
    24
    Tokens
    0

    Default

    As said that has been coded terribly, I can't even help you because I cba going through thousands of blank lines. You should try recoding it.

  10. #10
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Invent View Post
    That looks awful Jack
    Agreed.

    I thought functions we're case sensitive

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •