Results 1 to 7 of 7

Thread: Javascript Problem in PHP?

  1. #1
    Join Date
    Feb 2006
    Posts
    236
    Thanks
    8
    Thanked 3 Times in 3 Posts

    Default Javascript Problem in PHP?

    I'm using a php password protection scheme for several pages, and one (only this one) has a problem with the screen comming up blank on entering the first time after signing in. The second time, it's ok. It contains two javascript external references, e.g.:
    Code:
    <script language="javascript" src="chainedmenu1.js"></script>
    Other protected pages contain embedded javascript, and there is no problem. ALL of the php code is identical. AND, it only happens with FF! When using IE, all of the pages operate correctly (and that's unusual). Has anyone else encountered anything like this?

  2. #2
    Join Date
    Aug 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hi, i cant help you but can i have the script?

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    WestCoast, try http://www.twey.co.uk/?q=loginscript. It requires PHP and MySQL.

    Strangeplant, can you provide a demo?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Feb 2006
    Posts
    236
    Thanks
    8
    Thanked 3 Times in 3 Posts

    Default

    Thinking about this again, I can see how logic has failed me: I'm a scientist, not a real programmer, and using observations and the implied constraints on cause and effect have gotten me into numerous dead ends.

    I found the problem and corrected the error, finally. I was deceived by known error paths and my prediction of their causes based on browser performance. I'll know better than to believe in apparent 'evidence' next time.

    Programming is a performance art.

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I'm a scientist, not a real programmer, and using observations and the implied constraints on cause and effect have gotten me into numerous dead ends.
    What, you expect computers to be logical or something?

    Both Javascript and PHP are filled with little surprises for the novice programmer.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default

    Simpler login script, may work easier?

    PHP Code:
    $username "admin";
    $password "testing";
    $self "testing.php";

    if (
    $_POST['username'] != $username || $_POST['password'] != $password) {
    echo

    // FORM HERE, two fields: username and password
    ;

    else {
    echo 

    // PASSWORD PROTECTED INFORMATION HERE

    ;}


    It doesn't require javascript, which is a plus...
    I dunno
    If anyone wants it.

  7. #7
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    I'm a scientist, not a real programmer, and using observations and the implied constraints on cause and effect have gotten me into numerous dead ends.
    All coding in general doesn't make assumptions like a human would. You have to define everything that you could use in a script.
    - Mike

Bookmarks

Posting Permissions

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