Hi,
Am relatively new to PHP and wud appreciate if anyone can help me out...
My URL using the GET method reads as following..
http://feedback.php?date=10-11-2001&policy_codes=1&cbox=on&desc=aaaa&policy_codes=9&cbox=on&desc=bbbbb&temp=tp
Now, I have to insert the data into an MySQL table but am not able to split the URL such that the policy codes,cbox and desc are inserted twice rather than only the last one...
The variable has to necessarily be the same name...
any suggestions??
thnx, gaucho
I would have thought these duplicate variables would be stored in an array, so you should be able to access their values like this:
$cbox[0] // first value $cbox[1] // second value $desc[0] // first $desc[1] // second
hope this has helped.
I would say unless you state that you want to put it into an array the second variable will over write the first... Try renaming your form fields so they have different names. That will avoid any confusion!
Oops, sorry, I forgot to mention you would have to add [] to the form variables in the HTML for an array to be used.
<input type="text" name="desc[]">
🙂