Jump to content

dooh

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dooh's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you kenrbnsn, Here is your answer back... $number1_received = $_POST['number'][0]; $number2_received = $_POST['number'][1]; $number3_received = $_POST['number'][2]; echo $number1_received; echo "\n"; echo $number2_received; echo "\n"; echo $number3_received; echo "\n"; but...is this what you meant? Andrew
  2. Here ya go, <form action = "$self" method = "post"> <input type="hidden" name="number" value="dx2201"> <input type="hidden" name="number" value="dx108"> <input type="hidden" name="number" value="sx9"> <input type="hidden" name="number" value="fx1"> <input type = "submit" value = "Submit"> </form> Andrew
  3. Hello, I am posting numbers. the name = number for all names = ...and the value = different numbers eg...fx1005 or dx33 or sx9 the fx, dx, sx is just added to the number and it tells me what to do with the value when I get it here is the code I wrote to get the values back: $numbers_received = array(); $numsA = array(); $counter = 0; $numbers_received = $_POST['number']; foreach($numbers_received as $value) { $numsA[$counter] = "$value"; $counter = $counter + 1; } and now to look at what I received.. echo $numsA[4]; I get this error in the log: invalid argument supplied foreach() It leads me to believe that what was posted was not an array. Is this true? Is there a way for me to do this? This was just a test sending 10 numbers and I had hoped that it would echo a result..it did not I can do this a long way but, using perl reasoning fIigured something like this could be done in php too.. with fewer keystrokes I'm new to php so don't laugh. Andrew
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.