SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    May 2002
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Problem Posting data from a HTML form to PHP

    I am having trouble posting data from a HTML form to a PHP page. If I try to access the data from a text field called MYFIELD in a variable $MYFIELD, the variable is empty.

    Does anyone know why this isn't working? Is it aproblem with the php configuration?

    Thanks

  2. #2
    SitePoint Wizard
    Join Date
    Jul 2001
    Location
    The Netherlands
    Posts
    2,617
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First of all, this is kind of the wrong forum for a question like this. It should be posted in the PHP Programming section.
    I will ask an Advisor to move it there for you.

    As to the question, it could well be because of the version of PHP you are running. With the release of PHP 4.2.0, you need to call on those variables form their respective arrays. If you submitted the variable using get or post, you should call the variable using respectively: $_GET['var'] and $_POST['var].
    Last edited by Mark T.; May 3, 2002 at 08:25.

  3. #3
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Moved from Community Assistance...
    Wayne Luke
    ------------


  4. #4
    web daemon jorasmi's Avatar
    Join Date
    Nov 2001
    Location
    Philippines
    Posts
    296
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    better if you'll post here your code so we can see the error

  5. #5
    Wibblesticks Gryff's Avatar
    Join Date
    Oct 2001
    Location
    Asgard
    Posts
    442
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm assuming its a register globals problem.

    add
    $myfield = $_POST["myfield"];
    to the top of your php script.


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
  •