Page 3 of 6 FirstFirst 123456 LastLast
Results 21 to 30 of 54

Thread: Please Help

  1. #21
    Join Date
    Feb 2006
    Location
    Ontario Canada
    Posts
    4,587
    Tokens
    0

    Latest Awards:

    Default

    you could always do it easy way. password protect the admin directory using cpanel
    Last edited by Colin-Roberts; 09-08-2006 at 01:43 PM.

    .:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
    .:.: Stand up for what is right, even if you stand alone:.:.


  2. #22
    Join Date
    Aug 2006
    Posts
    282
    Tokens
    0

    Default

    Nooo i am trying to make a form where you type in a username and password and it adds it to log.txt so it makes a user.

    Try and fix my code ;D

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

    Default

    I know! 1 Sec
    Last edited by Fujitsu; 09-08-2006 at 01:48 PM.
    PHP Code:
    [LEFT]<?[/LEFT]
    [
    LEFT]$name $_GET['name'];[/LEFT]
    [
    LEFT]echo "Hi, your name is $name";[/LEFT]
    [
    LEFT]?>[/LEFT]
    [LEFT][/LEFT]

  4. #24
    Join Date
    Feb 2006
    Location
    Ontario Canada
    Posts
    4,587
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    <html>
    <head>
    <title>PixelResources User 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'>
    <b>Add an admin</b><br><br>
    <FORM name="shout" action="adduser.php" method="POST">
    Username;<br>
    <INPUT TYPE="TEXT" name="name" size="20"><br><br>
    Password;<br>
    <INPUT TYPE="TEXT" name="password" size="20"><br><br>
    <br><br>
    <INPUT TYPE="Submit" name="submit" value="Create Admin" size="20">
    </FORM>
    <br>

    </font>

    <?php

    // Copyright 2006 - 2007 PixelResources

    ?>

    </body>
    </html>
    PHP Code:
    <?php

    $name 
    $_POST['name'];
    $password $_POST['password'];

    if(empty(
    $name) OR empty($password))
    {
    echo 
    "

    <script language='javascript'>

    alert('Please fill in both the Username and the Password fields...');

    </script>
    "
    ;

    }
    else
    {

    echo 
    "

    <script language='javascript'>

    alert('The user was successfully created...');

    </script>
    $write = fopen("/users/log.txt", "w");
    fwrite(
    $write, "$name $password");
    fclose(
    $write);
    }
    [B](this part below makes no sense)[/B]

    "
    ;
    $name = ($name);
    $message = ($message);
    $tag = ("<font size=\"1\" face=\"Verdana\">
    $name||$message||<br>");


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

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

    // Copyright 2006 - 2007 PixelResources

    ?>

    .:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
    .:.: Stand up for what is right, even if you stand alone:.:.


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

    Default

    OK make adduser.php

    PHP Code:
    <?php

    $name 
    $_POST['name'];
    $website $_POST['website'];
    $message $_POST['message'];

    if(empty(
    $name) OR empty($message))
    {
    echo 
    "

    <script language='javascript'>

    alert('Please fill in both the Username and the Password fields...');

    </script>
    "


    }
    else
    {

    echo 
    "

    <script language='javascript'>

    alert('The user was successfully created...');

    </script>
    "

    $name = ($name);
    $message = ($message);
    $tag = ("<font size=\"1\" face=\"Verdana\">
    $name||$message||<br>");


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

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

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

    // Copyright 2006 - 2007 PixelResources

    ?>
    PHP Code:
    [LEFT]<?[/LEFT]
    [
    LEFT]$name $_GET['name'];[/LEFT]
    [
    LEFT]echo "Hi, your name is $name";[/LEFT]
    [
    LEFT]?>[/LEFT]
    [LEFT][/LEFT]

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

    Default

    YEy thankyou Fujitsu it works ;D

  7. #27
    Join Date
    Feb 2006
    Location
    Ontario Canada
    Posts
    4,587
    Tokens
    0

    Latest Awards:

    Default

    lol stupid fujitsu make dots look bad again
    what's next page ryan?
    Last edited by Colin-Roberts; 09-08-2006 at 02:05 PM.

    .:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
    .:.: Stand up for what is right, even if you stand alone:.:.


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

    Default

    Lolsor.

    A4AOwen (Forum Moderator) - Please do not post pointlessly.
    Last edited by A4AOwen; 09-08-2006 at 05:51 PM.
    PHP Code:
    [LEFT]<?[/LEFT]
    [
    LEFT]$name $_GET['name'];[/LEFT]
    [
    LEFT]echo "Hi, your name is $name";[/LEFT]
    [
    LEFT]?>[/LEFT]
    [LEFT][/LEFT]

  9. #29
    Join Date
    Aug 2006
    Posts
    282
    Tokens
    0

    Default

    Yep i need a word filter next, help me please Fujitsu...

    Edit: also anyone who wants to have a look in the admin panel PM me your MSN.
    Last edited by Drugs; 09-08-2006 at 02:06 PM.

  10. #30
    Join Date
    Feb 2006
    Location
    Ontario Canada
    Posts
    4,587
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    function filter($msg)
    {
    $bad_words explode(','"tomato,lettuce,carrot,potato,broccoli,cucumber,pea" );
      foreach (
    $bad_words as $naughty)
       {
      
    $msg eregi_replace($naughty"****"$msg);
       }
    return 
    $msg;

    credit to mentor

    .:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
    .:.: Stand up for what is right, even if you stand alone:.:.


Page 3 of 6 FirstFirst 123456 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
  •