Author Topic: PHP Help  (Read 2385 times)

Canuck

  • Eh?!!
  • Founders
  • Posts: 792
  • Karma: +51/-3
  • Andy Moog Fan
    • My Website
PHP Help
« on: April 10, 2008, 10:25:50 PM »
I have an input form with 7 drop downs pairs (Item/Item Colour).

I want to loop through to check if they are empty ($_POST['items1'], $_POST['items2'].... $_POST['items7']).. same thing for item colour.

I wanted to loop through, assign my loop variable to a variable with text
$item_val = "items".$i;
then check if $_POST['$item_val'] is empty.  I have tried ${$item_val}, nothing seems to work.

Is there anyway to achieve this?

Thanks

Mike

  • Jackass In Charge
  • Posts: 11257
  • Karma: +168/-32
  • Ex Asshole - a better and more caring person.
Re: PHP Help
« Reply #1 on: April 10, 2008, 11:47:00 PM »
$_POST[$item_val] not $_POST['$item_val']

Canuck

  • Eh?!!
  • Founders
  • Posts: 792
  • Karma: +51/-3
  • Andy Moog Fan
    • My Website
Re: PHP Help
« Reply #2 on: April 11, 2008, 05:31:04 PM »
Thanks