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 8 of 8

Thread: HMM HELP ME!

  1. #1
    Join Date
    Aug 2006
    Posts
    282
    Tokens
    0

    Default HMM HELP ME!

    Ok for the first bit i need help, on the thing i use normally you have to add users manually to a txt file like this;

    User1||password||
    User2||password||
    User3||password||

    And so on, now i am trying to make an automated process and here is what i have;

    newuser.php

    PHP Code:
    <html>
    <head>
    <title>PixelResources Announement Creator</title>
    </head>
    <body>

    <?php
    if($_COOKIE['in'] == "1"){}
    else{
    die(
    "You are not authrised to view this page.");

    ?>

    <font size=1> <font face='verdana'>

    <FORM name="shout" action="makeuser.php" method="POST">
    Username;<br>
    <INPUT TYPE="TEXT" name="username" size="20"><br><br>
    Password;<br>
    <INPUT TYPE="TEXT" name="password" size="20"><br><br>
    <INPUT TYPE="Submit" name="submit" value="Create User" size="20">
    </FORM>
    <br>

    </font>

    <?php

    // Copyright 2006 - 2007 PixelResources

    ?>

    </body>
    </html>
    and makeuser.php

    PHP Code:
    <?php

    $username 
    $_POST['username'];
    $password $_POST['password'];

    if(empty(
    $username) OR empty($password))
    {
    echo 
    "You forgot to fill in one or more of the form fields..";


    }
    else
    {

    echo 
    "

    <script language='javascript'>

    alert('User successfully added...');

    </script>
    "
    ;
    $username = ($username);
    $password = ($password);
    $tag = ("$username||$password||<br>");


    $read fopen("users/users.html""r");
    $contents fread($readfilesize('users/users.html'));
    fclose($read);

    $write fopen("users/users.html""w");
    fwrite($write"$tag $contents");
    fclose($write);
    }

    print 
    "<meta http-equiv=\"refresh\" content=\"0;adminindex.php\">";

    // Copyright 2006 - 2007 PixelResources

    ?>
    Basically when i do that, it comes out like this in the txt file;

    User1||password|| User2||password|| User3||password||

    And it doesn't work, i need to to go onto a new line each time i add a user, can someone edit the makeuser.php code so it will do that, thanks!
    Last edited by Drugs; 09-08-2006 at 06:59 PM.

  2. #2
    Join Date
    Aug 2006
    Location
    United Kingdom
    Posts
    207
    Tokens
    0

    Default

    PHP Code:
    <?php

    $username 
    $_POST['username'];
    $password $_POST['password'];

    if(empty(
    $username) OR empty($password))
    {
    echo 
    "You forgot to fill in one or more of the form fields..";


    }
    else
    {

    echo 
    "

    <script language='javascript'>

    alert('User successfully added...');

    </script>
    "
    ;
    $username = ($username);
    $password = ($password);
    $tag = ("<br>$username||$password||<br>");


    $read fopen("users/users.html""r");
    $contents fread($readfilesize('users/users.html'));
    fclose($read);

    $write fopen("users/users.html""w");
    fwrite($write"$tag $contents");
    fclose($write);
    }

    print 
    "<meta http-equiv=\"refresh\" content=\"0;adminindex.php\">";

    // Copyright 2006 - 2007 PixelResources

    ?>
    Last edited by Fujitsu; 09-08-2006 at 07:06 PM.
    PHP Code:
    [LEFT]<?[/LEFT]
    [
    LEFT]$name $_GET['name'];[/LEFT]
    [
    LEFT]echo "Hi, your name is $name";[/LEFT]
    [
    LEFT]?>[/LEFT]
    [LEFT][/LEFT]

  3. #3
    Join Date
    Aug 2006
    Posts
    116
    Tokens
    0

    Default

    I saw something like this... I can't remember if it was on techtuts... Try it (as soon as its back), maybe it'll be a help...

    (BTW, Ryan, check the shoutbox!)

    Edit: Fujitsu has posted
    Last edited by Internet; 09-08-2006 at 07:08 PM.

  4. #4
    Join Date
    Aug 2006
    Posts
    282
    Tokens
    0

    Default

    Fujitsu i tried that it doesn't even post it onto the txt file when you do that.

    Edit: Actually it just posts;

    Code:
    <br>User1||password||<b>
    Last edited by Drugs; 09-08-2006 at 09:24 PM.

  5. #5
    Join Date
    Aug 2006
    Location
    United Kingdom
    Posts
    207
    Tokens
    0

    Default

    I dunno, I'll help tomorrow. Too tired, cba looking at code Cba going to bed, I'd rather lie on the sofa on teh laptop atm. Mind you, I'll probably fall asleep on the sofa.
    PHP Code:
    [LEFT]<?[/LEFT]
    [
    LEFT]$name $_GET['name'];[/LEFT]
    [
    LEFT]echo "Hi, your name is $name";[/LEFT]
    [
    LEFT]?>[/LEFT]
    [LEFT][/LEFT]

  6. #6
    Join Date
    Aug 2006
    Posts
    282
    Tokens
    0

    Default

    Okay :{

  7. #7
    Join Date
    Aug 2006
    Location
    England
    Posts
    42
    Tokens
    0

    Default

    Ryan, thanks to these codes PHP is becoming more clear for me With all the echo and $username stuff. TY!<£

  8. #8
    Join Date
    Aug 2006
    Posts
    282
    Tokens
    0

    Default

    What lol?

    Ok anyway..

Posting Permissions

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