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 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default Best way of temp storing infomation?

    Well say on a register page, if you get a field wrong, normaly you would have to enter them all again. So what would be the best way so that if you get a field wrong, the information is saved.

    Moved by Invent (Forum Moderator) from Designing & Development: Please post in the correct forum next time, thanks .
    Last edited by Invent; 24-08-2008 at 01:30 AM.

  2. #2
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    Cookies
    Coming and going...
    Highers are getting the better of me

  3. #3
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default

    Quote Originally Posted by MrCraig View Post
    Cookies
    Thought so

  4. #4
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    Or you could make it really clever and have a MySQL memory table. Although cookies would suffice.
    How could this hapen to meeeeeeeeeeeeeee?lol.

  5. #5
    Join Date
    Jul 2008
    Location
    Leeds, UK
    Posts
    47
    Tokens
    0

    Default

    If you was processing the data on the same page you could just put a value on the field and put <? echo $_POST[FIELD NAME]; ?> or w.e it is in the language your using and do it that way

  6. #6
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default

    Quote Originally Posted by Hypertext View Post
    Or you could make it really clever and have a MySQL memory table. Although cookies would suffice.
    Cookies would be easier, then i dont have to do much.

    Humm, I having a problem though. When I submit the form and its wrong, it displays the old cookies the time before.
    I have made it update the cookies before returning them also.

    Edit: *slaps self*
    I just remembered, when im posting to the same page, I dont have to
    Last edited by Moh; 23-08-2008 at 08:52 PM.

  7. #7
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    I just do

    PHP Code:
    if ($_GET['action'] === send) {
       
    //validatecode
       
    if ($validate === done) {
          
    //add to db or flatfile code
          
    header locationdone.php );
       }
    }
       
    $age addslashes$_POST['age'] );
       echo (
    '<form action="?action=send" method="post">');
       echo (
    '<input type="text" name="age" value="$age">');
       echo (
    '<input type="submit">
       echo ('
    </form>'); 
    Lets set the stage on fire, and hollywood will be jealous.

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

    Latest Awards:

    Default

    Quote Originally Posted by Hypertext View Post
    Or you could make it really clever and have a MySQL memory table. Although cookies would suffice.
    There's no point in that, that's wasting database space, if a user doesn't finish the registration (and sufficing you have specified for it to be removed), it's not going to be removed.

    Of course there are other ways to remove it, but that's just more work for such a simple task.

    Quote Originally Posted by Jack120 View Post
    Cookies would be easier, then i dont have to do much.

    Humm, I having a problem though. When I submit the form and its wrong, it displays the old cookies the time before.
    I have made it update the cookies before returning them also.

    Edit: *slaps self*
    I just remembered, when im posting to the same page, I dont have to
    I wouldn't recommend cookies.

    Just use sessions, easy enough, and they only last for that browser session, so there's no worrying about wasted data.

  9. #9
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    yeah but at least with cookies, if the browser freakishly closes then theres no need to re-input the data.

    All depends whether you want that to happen or not.
    Coming and going...
    Highers are getting the better of me

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

    Latest Awards:

    Default

    Yeah, but if cookies are turned off? Then it isn't going to work, at least with sessions it's going to work without relying exclusively on browser settings.

Page 1 of 2 12 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
  •