php and apache problem
Results 1 to 3 of 3

Thread: php and apache problem

  1. #1
    Senior Member ShippMA's Avatar
    Join Date
    Oct 2002
    Posts
    165

    php and apache problem

    I'm trying to set up the apache server with php as a module so that i can test scripts. I don't want to host anything. When i create a simple html and php file to work together it doesn't eg

    index.html
    <html><body>
    <form method = 'post' action = ./name.php>
    <input type = 'text' name = 'fname'>
    <input type = 'submit' value = 'submit'>
    </form</body></html>

    name.php
    <?php
    $test = 'test';
    print $fname;
    print $test;
    ?>

    when i view this using http:\\localhost

    i see index.html enter a name hity submit, but then all it shows is the value in $test, not in $fname?

    any ideas, i'm assuming it must be how i installed apache and php, but i thought i followed everything.

    i'm using win 98se, apache1.3.27 and php4.3.1

    when apache console opens it gives no errors and says php is running.

  2. #2
    Senior Member
    Join Date
    Jan 2002
    Posts
    1,207
    You cannot use globals for posted variables if register_globals is off, I recommend you leave it that way (it is off by default)

    Try

    PHP Code:
    $_POST['fname'
    Instead of just $fname

  3. #3
    Senior Member ShippMA's Avatar
    Join Date
    Oct 2002
    Posts
    165
    Cheers, works fine now, just read the bit in php.ini about the register_globals being off, think i'll take yours and there advice and leave it off, figure best to try and learn it the right way

    Cheers
    www.simpleits.co.uk
    www.tazforum.**********.com
    Google is god ....... of the Internet

Posting Permissions

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