The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 8 of 8

Thread: multiple names for PHP login

  1. #1
    44
    posts
    Registered User

    multiple names for PHP login

    Hi there..


    I have a simpel login app in flash. The code i put in, is taken from a name in a login.php file.

    Here is a the code line for the name to be entered:

    Code:
     $passw = "random";

    Now, im no php authour at all. How can i add more names in that line?

    Regards Hrbi

  2. #2
    You don't enter any names in that line period... passw is probably an abbreviation for password... so if you wanted to add more users you're gonna have to post the whole script to get help.
    Let us live so that when we come to die even the undertaker will be sorry. - Mark Twain
    Don't PM me your CSS, xHTML, JS or PHP questions. I will not reply to ANY IE6 questions.

  3. #3
    44
    posts
    Registered User
    Hey..

    Ok, yeah offcourse.. here is the hole script

    <?
    $passw = "random";
    $txtpassw = $_POST['passw'];

    if ($txtpassw == $passw) {
    echo "&ok=OK";
    $toSave = "status=online";
    $fp = fopen("status.txt", "w");
    fwrite($fp, $toSave);
    fclose($fp);
    } else {
    echo "&ok=NO";
    }

    ?>
    I hope this help

    Regards Hrbi

  4. #4
    two mins (edit)
    Web Design and Web Development blog
    Designer Notice: Browser List for design compatibility

  5. #5
    try this:
    PHP Code:
    $passw = array('random''otherpassword''again''etc';
    $txtpassw $_POST['passw'];

    if (
    in_array($txtpassw$passw)) {
    echo 
    "&ok=OK";
    $toSave "status=online";
    $fp fopen("status.txt""w");
    fwrite($fp$toSave);
    fclose($fp);
    } else {
    echo 
    "&ok=NO";
    }

    ?> 
    don't really know what the scripts supposed to do though.
    Web Design and Web Development blog
    Designer Notice: Browser List for design compatibility

  6. #6
    44
    posts
    Registered User
    Damm... It looked good, but it did not work :-(

    Hmm

  7. #7
    Didn't work? Any errors?
    Web Design and Web Development blog
    Designer Notice: Browser List for design compatibility

  8. #8
    Oh I see it, this line:
    PHP Code:
     $passw = array('random''otherpassword''again''etc'
    I forgot the ).
    Should read:
    PHP Code:
     $passw = array('random''otherpassword''again''etc'); 
    Web Design and Web Development blog
    Designer Notice: Browser List for design compatibility

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012