You are here: Re: Help with posting form fields « PHP Programming Language « IT news, forums, messages
Re: Help with posting form fields

Posted by mickey on 11/19/34 11:45

Works beautifully, thank you!

Ken Robinson wrote:
> mickey wrote:
>> I have a form like the one below. Upon submit I would like to self post
>> to the same page but have the original $_POST data( which was posted to
>> this page from another ) also be sent along with the new form field
>> data. How can I achieve that? Thanks.
>
> You could use hidden fields to pass the data
>
>>
>> <form name="form1" method="post" action="<?php echo
>> $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']; ?>">
>> <table>
>> <tr>
>> <th><input type="text" name="fields[]"</th>
>> ...
>> <th><input type="text" name="fields[]"</th>
>
> <?php
> foreach($_POST as $k => $v)
> echo '<input type="hidden" name="' . $k . '" value="' .
> stripslashes($v) . '">';
> ?>
>
>> <th><input type="submit" value="Add" name="add"</th>
>> </tr>
>> </table>
>> </form>
>
> Ken
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация