Thread: Beginner - form

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    5
    Rep Power
    0

    Beginner - form


    Hi,

    If i have a form like this:

    < input name="submitted[name]">
    ... name="submitted[email]"
    ... name="submitted[subject]"


    what is the php code for retrieving the name, mail and subject and put them in $name, $email, $subject?

    Thanks!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,350
    Rep Power
    594
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,965
    Rep Power
    9397
    Only difference is that $_POST["submitted"] is what you need to look at, and it's an array.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    5
    Rep Power
    0
    Originally Posted by gw1500se
    Search engines are your friend.
    yes but like this is not working:
    $_POST['submitted[name]'];

    Comments on this post

    • gw1500se disagrees : Because you did not read the turorial. Arrays in PHP are never referenced like that.
  8. #5
  9. For POny!
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Location
    Amsterdam
    Posts
    416
    Rep Power
    115
    Originally Posted by wasssu1
    yes but like this is not working:
    $_POST['submitted[name]'];
    try
    PHP Code:
    echo $_POST['submitted']['name'];//name is the array key 
    Last edited by aeternus; December 17th, 2012 at 01:21 AM.
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    5
    Rep Power
    0
    Originally Posted by aeternus
    try
    PHP Code:
    echo $_POST['submitted']['name'];//name is the array key 
    Thanks, it's working like this!

IMN logo majestic logo threadwatch logo seochat tools logo