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!


Results 1 to 1 of 1

Thread: Not working.

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

    Latest Awards:

    Default Not working.

    How can I put the verification image in, i've tried everything I know, searched the web for hours, anyone? (I want it to actually work, not just making it display, if you can help Can you make it need the correct image code thing)

    PHP Code:
    <html><head>
    <style type="text/css">
    body, html{
    padding:0;
    margin:0;
    height:100%;
    }
    </style>

    <link href="http://www.habbomedia.net/panel-files/style.css" rel="stylesheet" type="text/css"><title>HabboMedia Staff System.</title></head><body background="http://www.habbomedia.net/panel-files/background.png">
    <div align="center">
      <table border="0" cellpadding="0" cellspacing="0" height="32" width="10%">
        <tbody><tr>
          <td align="center" background="http://www.habbomedia.net/panel-files/middle_login.gif" bgcolor="#ffffff" height="10">
          <font face="Verdana" size="1">         <br>    
        <img width="291" height="43" border="0" src="http://www.habbomedia.net/images/habbomediaheader.gif"><br>
            </font></td>
        </tr>
        <tr>
          <td align="center" background="http://www.habbomedia.net/panel-files/middle_login.gif" bgcolor="#ffffff" height="3">
    <form action="<?php echo "$PHP_SELF"?>?go=login" method="POST">

                      <table align="center" border="0" id="table4" style="width: 346px">

        <tr>

            <td style="width: 58px">
    <center style="width: 166px">
            <p><br>
        <tr>

            <td align="left" style="width: 58px">

            <p align="center"><b><font size="1" face="Verdana">Username:</font></b></td>

            <td align="left">
            <p align="center">
            <font face="Verdana">
            <input class="boarder" size="25" name="username_post" style="float: left; border: 1px dashed #000000"></font></td>

            </tr>

            <tr>

            <td align="left" style="width: 58px">

            <p align="center"><b><font size="1" face="Verdana">User PIN: </font></b></td>

            <td align="left">
            <p align="center">
            <font face="Verdana">
            <input type="password" name="pin_post" size="25" style="float: left; border: 1px dashed #000000"></font></td>

            </tr>
        <tr>

            <td align="left" style="width: 58px">

            <p align="center"><font size="1" face="Verdana"><b>Verification Image:</b></font></td>

            <td align="left">

            <p align="center"><font face="Verdana" size="1" color="#FFFFFF"> 

            <input type="img" name="verif_post" size="25" style="float: left; border: 1px dashed #000000"><br><br>Enter the image you see below<br>sdf</font></td>

        </tr>

        <tr>

            <td align="left" style="width: 58px">

            <p align="center"><font size="1" face="Verdana"><b>Password:</b></font></td>

            <td align="left">

            <p align="center"><font face="Verdana" size="1" color="#FFFFFF"> 

            <input type="password" name="password_post" size="25" style="float: left; border: 1px dashed #000000"></font></td>

        </tr>

    </table>
        
                      <p align="center">
                        <font size="1" face="Verdana" color="#FFFFFF"><input type="submit" value="Login" name="Submit" style="border-style:dashed; border-width:1px;"> <input type="reset" value="Reset" name="Reset" style="border-style:dashed; border-width:1px;"></font></p>
                        <font face="Verdana"></center>
                        </font>
                </form>
    <font face="Verdana"></font>

    </font>

    <p align="center" style="width: 276px; height: 73px">
    Welcome to the HabboMedia Staff Panel, this is for HabboMedia Staff to login, if 
    you are staff please login using the form above please also remember, this panel 
    is <strong>case sensitive</strong>, so make sure you login with the correct 
    information, we log all login attempts to the HabboMedia Staff Panel, make sure 
    that the information you login with is fully correct, we may ban you on a 
    certain number of login attempts to the DJ Panel.</p><br>
    <?php

    session_start
    ();

    $host "DATABASE INFORMATION CLEARED";

    $user "DATABASE INFORMATION CLEARED";

    $pass "DATABASE INFORMATION CLEARED";

    $db    "DATABASE INFORMATION CLEARED";

    $ms mysql_connect($host$user$pass);

    if(!
    $ms) { echo "Error connecting to database.\n"; }

    mysql_select_db($db);



    if(
    $_GET['go'] == "login") {

    $user1_post addslashes($_POST["username_post"]);

    $pass1_post addslashes($_POST["password_post"]);

    $pin_post addslashes($_POST["pin_post"]);

    $pass1_post = ($pass1_post);


    if(
    $user1_post == "" or $pass1_post == "" or $pin_post == "") { echo "<b>Error:</b> You forgot to enter some information, chump!<br><img src='http://www.habbomedia.net/panel-files/bottom_login.gif'>"; exit; }



    list(
    $user) = mysql_fetch_array(mysql_query("SELECT `username` FROM `staff` WHERE username='$user1_post'"));

    list(
    $pass) = mysql_fetch_array(mysql_query("SELECT `password` FROM `staff` WHERE password='$pass1_post'"));

    list(
    $pin) = mysql_fetch_array(mysql_query("SELECT `pin` FROM `staff` WHERE pin='$pin_post'"));




    if(
    $user1_post == "$userand $pass1_post == "$passand $pin_post == "$pin") {

    $sql mysql_query("SELECT * FROM `staff` WHERE username='$user' AND password='$pass' AND pin='$pin'");

    if(
    mysql_num_rows($sql)!= 1) { exit; }

    $result mysql_fetch_array($sql);



    $_SESSION['session_username'] = $result['username'];

    $_SESSION['session_level'] = $result['level'];

    $_SESSION['session_ip'] = $_SERVER['REMOTE_ADDR'];



    echo 
    "Please wait; you are now being redirected!<meta http-equiv=\"refresh\" content=\"1;url=manage.php\"><br><img src='http://www.habbomedia.net/panel-files/bottom_login.gif'>";

            exit;

    } else { echo 
    "<b>Error:</b> The login information you entered is incorrect.<br><img src='http://www.habbomedia.net/panel-files/bottom_login.gif'>"; }

    } else { 
    ?>

    <p align="center" style="width: 276px; height: 0px">
    <br></p>

    </td>
        </tr>
        <tr>
          <td height="7"><div align="center">
            <font face="Verdana" style="font-size: verdana">
            <img src="http://www.habbomedia.net/panel-files/bottom_login.gif" height="7" width="362"></font></div></td>
        </tr>
      </tbody></table>
    </div></body></html>

    <?php ?>
    verification_image.class.php

    PHP Code:
    <?
        
        
    //
        // Verification Image.
        // v0.1 
        //
        // An antispam image, generates a code, creates an image out of it, and 
        // registers this code in a session. User input will be checked against 
        // this session value. If it is valid no spambot is the one that is submitting 
        // this form.
        //
        // Install instructions:
        // Put the file of your ttf in the same directory as this script. Also note that
        // you call session_start() before using this class in any script.
        // 
        // 
        // As always I appreciate feedback. So don't hesitate to contact me.
        //
        // author: Jaap van der Meer ([email protected])
        //

        
        
        
    class verification_image {
            
    // the image that will be outputted
            
    private $image;
            
            
    // the width of the image thats outputted
            
    private $_w;
            
            
    // the height of the image that's outputted
            
    private $_h;
            
            
    // the color used for the text
            
    private $text_color;
            
            
    // the background used in the the text
            
    private $bg_color;
            
            
    // the font to be user
            
    private $ttf_font;
            
            
    // constructor to setup the image properties
            // width - the width of the image
            // height - the height of the image
            // font - the font to be used, must be in same directory
            
    function verification_image($width 120$height 40$font "") {
                
    $this->_w $width;
                
    $this->_h $height;
                
                
    $this->ttf_font $font;
            }
            
            
            
    // initializes the image
            
    function init() {
                
                
    $this->image imagecreate($this->_w$this->_h);
                
    //$background_color = imagecolorallocate($this->image, 255, 255, 255);
                
    $this->set_bgcolor(255,255,255);
                
    $this->set_textcolor(255,34,91);
                
            }        
            
            
    // sets the bgcolor
            
    function set_bgcolor($r,$g,$b) {
                
    $background_color imagecolorallocate($this->image$r$g$b);    
                
            }
            
            
    // sets the textcolor
            
    function set_textcolor($r,$g,$b) {
                
    $this->text_color imagecolorallocate($this->image$r$g$b);    
            }
            
            
    // draws the string
            
    function draw() {
                
    $code $this->generate_code();
                
    // register the code in the session
                
    $this->register_code($code);
                
                
    // offsets for x and y in the image
                
    $x 1;
                
    $y 20;
                
                
    // walk through each character in the 
                // code, to print it 
                
    for($i 0$i strlen($code); $i++) {
                
                    
    $calc_y rand(200,250) / 10;
                    
    //imagestring( $this->image, 3, $x, $calc_y,  $code{$i}, $this->text_color);    
                    
    $angle rand(-20,20);
                    
    $this->write_string($x$calc_y$angle$code{$i});
                        
    $x += rand(17,19) ;
                }
                
            }
            
            
            function 
    write_string($x_offset$y_offset$angle$string) {
                    
                    
    // check if a font is set
                    
    if($this->ttf_font != "") {
                        
    // does the file font exist on the server
                        
    if(file_exists($this->ttf_font)) {
                            
    putenv('GDFONTPATH=' realpath('.'));
                            
    $font_size 20;
                            
    $grey imagecolorallocate($this->image128128128);
                            
    // draw a shadow
                            
    imagettftext($this->image$font_size$angle$x_offset 1$y_offset 1$grey$this->ttf_font$string);
                            
    // draw the text    
                            
    imagettftext($this->image$font_size$angle$x_offset$y_offset$this->text_color$this->ttf_font$string);
                        
                        } else {
                            die(
    "Font doesn't exist, or not in same directory as a .ttf");
                        }
                    } else {
                        die(
    "No font set.");
                    }
            }
            
            
    // generates a time based random code
            // offset is the minutes to be added
            
    function generate_code() {
                
    // define the seed out of which characters the seed will be constructed
                
    $string md5(rand(0,9999));
                
    $output substr($string146);
                return 
    $output;
            }
            
            
            
    // returns the code that is registered 
            // in the session
            
    function get_registered_code() {
                return 
    $_SESSION['verification_key'];
            }
            
            
    // sets the code, this will be registered as 
            // the code in the session
            
    function register_code($c) {
                
    $_SESSION['verification_key'] = $c;
            }
            
            
    // checks if the code is valid
            
    function validate_code($code) {
                return 
    $code == $this->get_registered_code(); 
            }
            
            
    // output it to screen
            
    function _output() {
                
    // initialize the image
                
    $this->init();
                
    // draw the image
                
    $this->draw();
                
                
    header("Content-type: image/png");            
                
    imagepng($this->image);
                
                
    // destroy the image to free resources
                
    imagedestroy($this->image);
            }
        
    }




    ?>
    Last edited by Independent; 16-02-2008 at 08:08 PM.

Posting Permissions

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