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 9 of 9
  1. #1
    Join Date
    Oct 2006
    Location
    BUXTON
    Posts
    2,191
    Tokens
    0

    Latest Awards:

    Default OurHabbo system Help

    IF YOU ARE GOING TO SAY IT IS UNSAFE AND DONT USE IT STOP READING NOW!

    Hi Habboxers

    I have contact.php works find but i want it so it can be used when logged out..

    At the moment u have to login and once on the page u just get a drop down menu with problem then a message can some one help by doing this


    dont have to login and you can do this...

    Name:
    dropdown menu stay same
    message stay same

    --------------------------------------------------------------------

    Basicly i want it so u dont login and u have to put your name in..

    ---------------------------------------------------------------------

    Heres the PHP for it.

    PHP Code:
    <html>
    <head>
    <title>Home</title>
    <style type="text/css">
    a {
    font-size: 10px;
    color: #000000;
    }
    a:link {
    text-decoration: none;
    color: #000000;
    }
    a:visited {
    text-decoration: none;
    color: #000000;
    }
    a:hover {
    text-decoration: underline;
    color: #000000;
    }
    a:active {
    text-decoration: none;
    color: #000000;
    }
    body,td,th,p {
    font-family: Verdana;
    font-size: 10px;
    color: #000000;
    }
    .12 { color: red; }
    .11 { color: navy; }
    .10 { color: ; }
    .9 { color: darkorchid; }
    .8 { color: darkorchid; }
    .7 { color: darkorchid; }
    .6 { color: darkorchid; }
    .5 { color: green; }
    .4 { color: green; }
    .3 { color: green; }
    .2 { color: green; }
    .1 { color: black; }
    input {
        font-family: Tahoma, Arial;
        font-size: 8pt;
        font-weight: bold;
        width: 200;
        color: #000000;
        background-color: #FFFFFF;
        border: 1px solid #000000;
    }
    select {
        background-color: #ffffff;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 8pt;
        color: #000000;
        width: 200;
        border: 1px solid #000000;
    }
    textarea {
    background-color: #ffffff;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 8pt;
        color: #000000;
        width: 200;
    height: 100;
        border: 1px solid #000000;
    }

    </style>
    </head>
    <body bgcolor="#ffffff">
    <?
    include("config.php");
    if(
    $logged[username]){
    ?>
    <p>OurHabbo Help Tool</p>
    <p>Please fill out the information below as needed, and send us your problem. We
    will reply within 24hours of your request being sent.</p>
    <form action='helptool.php' method='post'>

                <p><img border='0' src='images/1_hi.gif' align='left' width='51' height='42'>UserName<br>



    <input type='text' size='40' name='name' value='' style=\"font-size: 10px\" tabindex=\"1\"></p>
    <br>
                <p><img border='0' src='images/2_hi.gif' align='left' width='51' height='42'>Your Email<br>
    <input type='"email' size='40' name='email' value='' style=\"font-size: 10px\" tabindex='2'><br>
    <br>
    <br>

                <img border='0' src='images/3_hi.gif' align='left' width='51' height='42'>

    Message Type<br>



    <select size='1' name='type' tabindex='3'>
    <option>Please Select An Option...</option>
    <option>I have technical problems with the site</option>
    <option>I have a Billing/Sale Query</option>
    <option>I think I've been banned</option>
    <option>I have forgotten my password</option>
    <option>I want to report an illegal site</option>
    <option>I've been scammed!</option>
    <option>I have an idea/thought</option>
    <option>Something else</option>
    </select><br>

    <br><br>

                <img border='0' src='images/pass.gif' align='left' width='51' height='42'>

    Message<br>



    <textarea rows='10' cols='24' name='message' tabindex='4'></textarea><br>

    <br>

    <input type='submit' value='Email Us' name='submit' style=\"font-size: 10px\"></p>
    </form>

    <?
    }else{
    echo (
    "You are not logged in, or are banned.");
    }
    ?>
    </body>
    </html>
    Thanks Jamieb

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

    Default

    Basically what you would do is take the below part of the script and place it accordingly on the page so that if the user isn't logged in then there's a field for 'username' or something and when they are logged in it auto-assigns a username value...

    PHP Code:
    <!-- Open Form Tag -->
    <form> 
     
    <!-- Start PHP Conditionals -->
    <?
    include("config.php");
    if(
    $logged[username]){
     
    // Whatever the username session variable is should go below
    $username $_SESSION['username']; 
    ?>
     
    <!-- This will happen if the user is logged in -->
    <input type="hidden" name="username" value="<?=$username?>">
     
    <?
    }else{
    ?>
     
    <!-- This will happen if the user is not logged in -->
    Username:<br/>
    <input type="text" name="username" maxlength="30">
     
    <?php
    }
    ?>
    <!-- End PHP Conditionals -->
     
    <!-- This is where the rest of your form would go -->
     
    <!-- Close Form Tag -->
    </form>
    That should give you a general idea

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

    Latest Awards:

    Default

    Would it be easier to do
    PHP Code:
    <?
    include("config.php");
    if(!
    $logged[username]){
    header("Location: login.php");
    exit();
    }
    instead of all the jive at the end?
    How could this hapen to meeeeeeeeeeeeeee?lol.

  4. #4
    Join Date
    Oct 2006
    Location
    BUXTON
    Posts
    2,191
    Tokens
    0

    Latest Awards:

    Default

    I dont know php really at all so that didnt make alot of sence to me and +rep (scriptz)

  5. #5

    Default

    its unsafe

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

    Default

    Quote Originally Posted by Reconix View Post
    Would it be easier to do
    PHP Code:
    <?
    include("config.php");
    if(!
    $logged[username]){
    header("Location: login.php");
    exit();
    }
    instead of all the jive at the end?
    I think you might have missed what the original post was asking for. He doesn't just want to redirect users if they aren't logged in, he wants to add an additional form field for their 'name'.

    Quote Originally Posted by Unpredictible.1 View Post
    its unsafe
    Am I missing something? What is unsafe? There's no real security related code happening here or anything to do with a MySQL Database?

    Anyway, just to try and clarify what I said above.... The original form would stay the same and you would just put it where in my code example it says:

    <!-- This is where the rest of your form would go -->
    Only other issue would be that to handle the additional field you would require some more backend PHP stuff to handle it...

  7. #7
    Join Date
    Feb 2005
    Location
    USA
    Posts
    1,634
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Unpredictible.1 View Post
    its unsafe
    That's L!nk trying to annoy someone.


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

    Latest Awards:

    Default

    I'm not gonna' say it's unsafe.. But why does everyone use this system, it's rubbish?

  9. #9

    Default

    Quote Originally Posted by Scriptz View Post
    I think you might have missed what the original post was asking for. He doesn't just want to redirect users if they aren't logged in, he wants to add an additional form field for their 'name'.



    Am I missing something? What is unsafe? There's no real security related code happening here or anything to do with a MySQL Database?

    Anyway, just to try and clarify what I said above.... The original form would stay the same and you would just put it where in my code example it says:



    Only other issue would be that to handle the additional field you would require some more backend PHP stuff to handle it...
    wow ok.. :eusa_clap

    Quote Originally Posted by cunning View Post
    That's L!nk trying to annoy someone.
    It's cunning trying to attention seek.
    actually your post is correct, and its working

Posting Permissions

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