Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: fopen, fclose, fwrite....

  1. #11
    Join Date
    Feb 2007
    Posts
    601
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Here is what i want to be able to do in PHP if its even possible -
    Read the value written in a prompt box and then echo it onto the page...
    (and please answer the question aboove)

  2. #12
    Join Date
    Jun 2006
    Location
    Acton Ontario Canada.
    Posts
    677
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Quote Originally Posted by pcbrainbuster View Post
    Plus can javascript read/write/open/close files
    No. Thats what PHP is for.

    PHP stands for Pre-client Hypertext Processor. As in, your web browser never sees the PHP code.
    if you looked in your source, all you would see is this...
    Code:
    <button onclick="asd()">Test</button>
    <script>
    function asd() {
    You fool !
    }
    </script>
    You would need ajax to send the data to a php script, then put the result somewhere on your page.
    - Ryan "Boxxertrumps" Trumpa
    Come back once it validates: HTML, CSS, JS.

  3. #13
    Join Date
    Feb 2007
    Posts
    601
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yeah... I forgot about the parsing part of PHP. But I still don't understand the whole running PHP when its needed part - for an example say I wanted to click a button and make the time from PHP show up - how would that be done ?

    (I know that PHP does not connect with DOM but there should be a way to respond to things the user does - what can you really do with PHP apart from opening files closing them writing to them reading them ?)

  4. #14
    Join Date
    Feb 2007
    Posts
    601
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well is there anything else ???

  5. #15
    Join Date
    Feb 2007
    Posts
    601
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok i was on the web and found this password script -

    <form method="POST" action="example18.php3">
    <div align="left"><p><font face="BankGothic Md BT">Admin password?</font>
    <input type="password" name="pw" size="14"><input type="submit" value="Submit"></p>
    </div></form>

    How is this php script connecting to that -

    <?
    $adminpass = "test123";
    if ($pw == $adminpass)
    {
    print("Welcome to the administration area!");
    }
    else
    {
    print("Wrong password");
    }
    ?>

    I wonder

  6. #16
    Join Date
    Feb 2007
    Location
    Earth
    Posts
    133
    Thanks
    6
    Thanked 1 Time in 1 Post

    Default

    im sure if you set a cookie you would be safer, that way you can check the cookie for the correct username and password
    http://www.insanecombat.com << bored? check out ma game

  7. #17
    Join Date
    Feb 2007
    Posts
    601
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You misunderstand , what i needed to know is how this works but now understand most of it and now instead need to know that if only one submit button is allowed in a form (then it would make sense to me on how the whole thing works)

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
  •