Results 1 to 3 of 3

Thread: Problem submitting a form's data

  1. #1
    Join Date
    Apr 2005
    Location
    Devon, UK
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Problem submitting a form's data

    Hi, slight problem.

    I have a file (index.php) which is the main file running the whole site. Each link for each page calls
    Code:
    index.php?page=pagename
    Then depending on what pagename is by checking an array depends on which file is called using include().

    On my contactme.php file it detects the 'submit' button but doesn't seem to be finding anything in the forms. I've double checked the names of the text boxes in the forms and nothing is mistyped. I can't even store the contents of my form in variables in index.php with no checking then in my contactme.php file check to see if these variables contain the data I need them to contain.

    In the form (contactme.php) I'm using method="post"

    Am I making a silly mistake somewhere or is this one of those "local" variable things?

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

    Default

    You're using POST for the form, but GET for the page? I think you ought to check for both GET and POST in index.php so that you can submit to index.php with a hidden input called "page" with the value of "contactme." GET and POST don't mix well.
    How are you retrieving the variables? If you're using $fieldname, it probably won't pass as it should. Try using $_POST['fieldname']. $_GET and $_POST are autoglobals: they should be accessible from anywhere.
    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!

  3. #3
    Join Date
    Jun 2005
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    try $HTTP_POST_VAR or $HTTP_GET_VAR, by the way what is your php version

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
  •