Renlok Posted January 22, 2007 Share Posted January 22, 2007 he i have a question, ive made a form where you can update price of things in your shop. the form is just lots of[code]<input type="text" name="***" size="7" value="$shopprice">[/code]for each item in your shop each of while is got from a while loop.my question is what sould you name the input and what sould you have to process the variables when you go to update the prices. Link to comment https://forums.phpfreaks.com/topic/35216-how-to-use-form-variables-if-the-form-was-make-with-a-while-loop/ Share on other sites More sharing options...
trq Posted January 22, 2007 Share Posted January 22, 2007 You should use an arary for your input. eg;[code]<input type="text" name="input[]" size="7" value="$shopprice">[/code]Then, on the processing page you can loop through all the values using...[code]<?php foreach ($_POST['input'] as $k => $v) { echp "$k = $v<br />"; }?>[/code] Link to comment https://forums.phpfreaks.com/topic/35216-how-to-use-form-variables-if-the-form-was-make-with-a-while-loop/#findComment-166304 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.