Web Analytics Made Easy -
StatCounter Help - CodingForum


No announcement yet.


  • Filter
  • Time
  • Show
Clear All
new posts

  • Help

    OK I have an HTML page with 4 forms. I have the form action set to my PHP page which has the following source.....

    The two forms that I want to get the data from are named "Name" and "Location" .
    Before I used the $_REQUEST['Name'] and $_REQUEST['Location'] functions but it didnt work. Here is what I have now. Please help me with getting the input in the forms and writing it into the page.


    $name = "Name";
    $location = "Location";
    $file = "data.php";
    $fh = fopen($file, "w");
    fwrite($fh, $name . $password);

    echo ("Member Added");



  • #2
    We require everybody to read our posting guidelines before creating threads:

    CodingForum Supreme Overlord
    All Hail Spookster


    • #3
      1) Do not cross post your question in multiple forum categories ...... Ok
      2) Type in a subject that summarizes your question ........ Got that....
      3) Be descriptive and articulate when asking your question..... Yea...
      4) Be appreciative and follow up when getting a response........ errr I appreciate you telling me to look at the guidelines again..... but ummm... why?

      Can anyone help me with that by the way?


      • #4
        Spookster is talking about your thread title. 'Help' is not very descriptive. 'Cannot write $_REQUEST variables to a file' would have been a better choice.

        As for the problem.
        I have seen instances where $_REQUEST doesn't exist. And that is fine, feel free to create the $_REQUEST if you need to use it:
        $_REQUEST = array_merge($_GET, $_POST, $_COOKIE);
        for instance. I would recommend creating this anyway as you can then control what values override which, from left to right.
        As for your problem, it could be caused by any number of things.
        Check for these first:
        1. Directory/File is writable. If not, you cannot edit or create this file.
        2. fwrite() function is available for you to use.
        3. Shorttags are enabled.
        4. If you require text / binary specific identification, use 'w+b' instead of 'w'. In otherwords, always use 'wb' or 'w+b' for compatibility purposes. *nix should ignore the 'b' directive.
        5. error_reporting(E_ALL) will tell you what your actual problem is. Throw this at the top of your php.

        Take a look at those, and then see what the problem is. Error_reporting will tell you if the file is invalid, if the function is not usable, or if you don't have permissions to write to the file.
        PHP Code:
        header('HTTP/1.1 420 Enhance Your Calm'); 
        Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)