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 14
  1. #1
    Join Date
    Apr 2007
    Posts
    2,431
    Tokens
    0

    Latest Awards:

    Default I can't explain in title ...

    Basically, I am looking for a code where say...

    There is an input box, and you must enter a certain code to proceed to the next page. So say the code was 123, if u typed 29475 it would say something like 'unfortunately, your code is incorrect'.

    I'm needing it for a competition at school

    +rep for help

    [X] [X] [X]

  2. #2
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    image verification basically?
    Hi, names James. I am a web developer.

  3. #3
    Join Date
    Mar 2005
    Location
    London
    Posts
    4,402
    Tokens
    3,894
    Habbo
    Intricat

    Latest Awards:

    Default

    But number verification

    Basically a code could be:

    Randomly generate number
    Check if number entered = number displayed
    If yes, proceed
    If no, dont proceed

  4. #4
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    In a nutshell.
    Hi, names James. I am a web developer.

  5. #5
    Join Date
    Apr 2007
    Posts
    2,431
    Tokens
    0

    Latest Awards:

    Default

    Yeah, basically. But the code wouldn't be shown ...

    And I don't know PHP

    [X] [X] [X]

  6. #6
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    Quote Originally Posted by Pazza View Post
    Yeah, basically. But the code wouldn't be shown ...

    And I don't know PHP
    Im seriously tired I've coded 13 hours straight =/ but I'll give it ago. You need like a small jpeg and call it image.jpg - we'll use this to put the numbers on.

    Call that, whatever.html
    HTML Code:
    <form method="post" action="page.php">
    <img src="image.php"><br>
    <b>Image text:</b> <input type="text" name="image"><br>
    <input type="submit" value="SUBMIT">
    </form>
    Call this image.php (same directory as wwhatever.html)
    PHP Code:
    <?php
    session_start
    ();
    $numbers "1234567890";
    $random substr(str_shuffle($numbers), 010);
    $_SESSION["image"] = $random;
    $image imagecreatefromjpeg("image.jpg");
    $textColor imagecolorallocate ($image255,000,000);
    imagestring ($image3151$random$textColor);
    imagejpeg($image);
    imagedestroy($image);
    ?>
    Call this page.php
    PHP Code:
    <?php
    session_start
    ();
    // cheap and nasty php you get theidea
    if($_POST["image"] == $_SESSION["image"]) {
     echo(
    "yay you got it right");
    } else {
     echo(
    "you got it wrong, you fail.");
    }
    session_destroy();
    ?>
    you can use my image btw

    http://www.members.driftpanzy.co.uk/image.jpg

    Save it and upload it, dont hotlink me.

    Any problems, ask someone else. im tired.
    Last edited by Protege; 22-04-2008 at 05:41 PM.
    Hi, names James. I am a web developer.

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

    Latest Awards:

    Default

    Should work
    PHP Code:
    <?php

    if($_GET["act"] == "submit")
        {    
            
    $entry = ($_POST["entry"]);
            
    $answer = ($_POST["rand"]);
            
            if(
    $entry == $answer)
            {
            echo(
    "Well Done! You got it right. The answer was $answer.. you can replace this with the form or what ever.");
            } else {
            echo(
    "Ohh Noes! You got it wrong.. lol");
        }
        }
        else 
        {
            
    $rand rand();
            echo(
    "Please enter the following number in the box below:<br>$rand<br>
            <form method=\"post\" action=\"?act=submit\">
            <input readonly type=\"hidden\" name=\"rand\" value=\"
    $rand\">
            <input type=\"text\" name=\"entry\"><br><br>
            <input type=\"submit\" value=\"Submit\">
            </form>"
    );
        }
    ?>
    I kinda cheated by making a textbox store the code.

  8. #8
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    ehehehe Its easy to get past tho with robots.
    Hi, names James. I am a web developer.

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

    Latest Awards:

    Default

    Quote Originally Posted by DriftPanzy View Post
    ehehehe Its easy to get past tho with robots.
    Its only a competition at school..

  10. #10
    Join Date
    Apr 2007
    Posts
    2,431
    Tokens
    0

    Latest Awards:

    Default

    Yeah, for this enterprise evening.

    So in Jacks code,

    Do I specify a code, and that code is the only one accepted. So, basically the page will just be a box to type the code in, and a submit button. If I say the code is 123, if 123 is entered it will redirect to another page saying congrats you won bla bla bla. If it is the wrong one it will say sorry, you have lost. I don't mean there is a code shown, but 123 would be the only code that could be accepted ??
    Last edited by Pazza; 22-04-2008 at 07:33 PM.

    [X] [X] [X]

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
  •