PHP has "For each item in request.form...Next"?
Results 1 to 5 of 5

Thread: PHP has "For each item in request.form...Next"?

  1. #1
    Junior Member
    Join Date
    Jul 2002
    Posts
    15

    Cool PHP has "For each item in request.form...Next"?

    In ASP they have:
    for each item in request.form
    next

    I wonder does PHP has something similar?

  2. #2
    PHP and SQL Guru
    Join Date
    Jan 2001
    Posts
    1,031
    foreach ($_REQUEST as $key => $val) {
    echo 'asp sucks';
    }

  3. #3
    Junior Member
    Join Date
    Jul 2002
    Posts
    15

    but it didn't give me the name and value

    I tried:

    foreach ($_REQUEST as $key => $val) {
    echo $key & "-" & $val ;
    }

    But it didn't give me the name and it's value

    In ASP:
    For each item in request.form
    response.write item & "" & request.form(item)
    Next

  4. #4
    Junior Member
    Join Date
    Aug 2002
    Location
    Germany
    Posts
    27

    Re: but it didn't give me the name and value

    Originally posted by linda_says
    But it didn't give me the name and it's value
    Perhaps you are using an older version of PHP (before 4.1.0)
    $_REQUEST is one of the new global arrays!

  5. #5
    Junior Member
    Join Date
    Jul 2002
    Location
    NM
    Posts
    9
    Try this:
    PHP Code:
    foreach($HTTP_GET_VARS as $key => $value) {echo "$key => $value <br>";} 
    or this:
    PHP Code:
    foreach($HTTP_POST_VARS as $key => $value) {echo "$key => $value <br>";} 
    depending on what method you are using

    B

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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