Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27

Thread: Error Help/

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

    Latest Awards:

    Default

    Quote Originally Posted by Minor View Post
    Agreed.

    I thought functions we're case sensitive
    well no coz i use caps


    Quote Originally Posted by Invent View Post
    That looks awful Jack
    mehhhh

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

    Latest Awards:

    Default

    Quote Originally Posted by Jackboy View Post
    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
    Not standards.. <?php looks more professional.

    You mean mysql_fetch_array(), you don't need capitals.. it looks like crap

    If you're going to play with capitals, use the camel method, $this->fetchArray, $this->mysqlQuery, $this->numRows

    First word lowercase, second word uppercase.

    Quote Originally Posted by Excellent View Post
    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.
    Still looks awful, not aligned at all Looks like my pre-2006 coding.

  3. #13
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    I prefer
    PHP Code:
    $this->db->runResults(); 


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

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

    Latest Awards:

    Default

    Well since most of my applications are centered around the database, I just usually extend my core from the database, that way I can manage it, but your way is just as easy.

  5. #15
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    Have some clean code.

    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=" 
    $_SESSIONzetolic_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( 
    $fetchrank ] == )
                {
                    if( 
    $_SESSIONzetolic_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;
    }
    ?>


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

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

    Latest Awards:

    Default

    Quote Originally Posted by Dentafrice View Post
    Still looks awful, not aligned at all Looks like my pre-2006 coding.
    As I said, I'm not willing to spend time cleaning up his code if it's crappy just got rid of the 6 miles of white spaces you quite rightly pointed out and cleaned up his connection and echo spacing.

    @Jack - capitals doesn't look professional, looks like you're a shift abusing learner. As denta said if you want to use caps go to the scrappy method of using $this->

    @Jew - please tell me you were bored.
    Last edited by Excellent; 17-06-2008 at 04:46 PM.

  7. #17
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    Quote Originally Posted by Excellent View Post
    As I said, I'm not willing to spend time cleaning up his code if it's crappy just got rid of the 6 miles of white spaces you quite rightly pointed out and cleaned up his connection and echo spacing.

    @Jack - capitals doesn't look professional, looks like you're a shift abusing learner. As denta said if you want to use caps go to the scrappy method of using $this->

    @Jew - please tell me you were bored.
    I just right click then press format


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

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

    Latest Awards:

    Default

    What program

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

    Latest Awards:

    Default

    Quote Originally Posted by Jewish Bear View Post
    I just right click then press format
    Get me a DL link to that version xx

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

    Latest Awards:

    Default

    Quote Originally Posted by Dentafrice View Post
    Get me a DL link to that version xx
    I second that "xx"

Page 2 of 3 FirstFirst 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
  •