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 2 FirstFirst 12
Results 11 to 19 of 19
  1. #11
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    mysql_real_escape_string cleans the given var so it is fit to be used in a sql query. It basically adds backslashes to the var in certain areas so that it can't be used in a query. This prevents SQL Injection.

    htmlentities converts HTML in the given var to standard code. So basically it would convert » to ».

    get_magic_quotes_gpc just checks if magic_quotes is enabled on the server

  2. #12
    Join Date
    Jul 2007
    Location
    Swindon
    Posts
    990
    Tokens
    125

    Default

    Thank you

  3. #13
    Join Date
    Jan 2007
    Location
    Canada eh?
    Posts
    766
    Tokens
    75

    Default

    Well... if you're making some sort of user system I always use Sessions instead of Cookies for a couple reasons:

    a) Sessions are automatically deleted every 24 mins or so
    b) Not all browsers have Cookies turned on
    c) Sessions are simpler to set and remove

    And as for the $_GET variables - I always try to avoid using them as much as possible unless you're talking like "yoursite.com?page=news" because if you use $_GET vars in place of Sessions and important data like that then its easier to hack or attempt to hack your system and manipulate your files, $_POST variables also work fairly well too for a variety of things.

    And like everyone's already said, make sure you clean your inputs! All of them (including $_GET's)! I use these php functions to do the dirty work:

    • htmlentities()
    • preg_match()
    • str_replace()
    • nl2br()


    Best of luck

  4. #14
    Join Date
    Jul 2007
    Location
    Swindon
    Posts
    990
    Tokens
    125

    Default

    Quote Originally Posted by Scriptz View Post
    Well... if you're making some sort of user system I always use Sessions instead of Cookies for a couple reasons:

    a) Sessions are automatically deleted every 24 mins or so
    b) Not all browsers have Cookies turned on
    c) Sessions are simpler to set and remove

    And as for the $_GET variables - I always try to avoid using them as much as possible unless you're talking like "yoursite.com?page=news" because if you use $_GET vars in place of Sessions and important data like that then its easier to hack or attempt to hack your system and manipulate your files, $_POST variables also work fairly well too for a variety of things.

    And like everyone's already said, make sure you clean your inputs! All of them (including $_GET's)! I use these php functions to do the dirty work:
    • htmlentities()
    • preg_match()
    • str_replace()
    • nl2br()

    Best of luck
    wat do thy do? so i can learn

  5. #15
    Join Date
    May 2007
    Location
    Nebo, NC, USA
    Posts
    2,517
    Tokens
    0

    Latest Awards:


  6. #16
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    If cookies are disabled sessions won't work anyway unless you pass the session id via GETs or POSTs since by default the session ID is stored in a cookie.

    Quote Originally Posted by Scriptz View Post
    Well... if you're making some sort of user system I always use Sessions instead of Cookies for a couple reasons:

    a) Sessions are automatically deleted every 24 mins or so
    b) Not all browsers have Cookies turned on
    c) Sessions are simpler to set and remove

    And as for the $_GET variables - I always try to avoid using them as much as possible unless you're talking like "yoursite.com?page=news" because if you use $_GET vars in place of Sessions and important data like that then its easier to hack or attempt to hack your system and manipulate your files, $_POST variables also work fairly well too for a variety of things.

    And like everyone's already said, make sure you clean your inputs! All of them (including $_GET's)! I use these php functions to do the dirty work:
    • htmlentities()
    • preg_match()
    • str_replace()
    • nl2br()

    Best of luck

  7. #17
    Join Date
    Jan 2007
    Location
    Canada eh?
    Posts
    766
    Tokens
    75

    Default

    Quote Originally Posted by Tomm View Post
    If cookies are disabled sessions won't work anyway unless you pass the session id via GETs or POSTs since by default the session ID is stored in a cookie.
    Okay, well let me re-phrase it then....

    Your browser security settings have to be pretty high/cookies completely blocked in order for it not to accept a PHP Session Id whereas the settings don't usually have to be as high for it to block other Cookies that you set directly... anyways...

    Atleast there are workaround with sessions if cookies are disabled!

  8. #18
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    The browser can't tell if its a PHP session ID or set by the script.

    Quote Originally Posted by Scriptz View Post
    Okay, well let me re-phrase it then....

    Your browser security settings have to be pretty high/cookies completely blocked in order for it not to accept a PHP Session Id whereas the settings don't usually have to be as high for it to block other Cookies that you set directly... anyways...

    Atleast there are workaround with sessions if cookies are disabled!

  9. #19
    Join Date
    Jul 2007
    Location
    Swindon
    Posts
    990
    Tokens
    125

    Default

    Quote Originally Posted by Dentafrice, View Post
    That site confuses me on how to navigate it :S

Page 2 of 2 FirstFirst 12

Posting Permissions

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