You are here: Re: Newbie - Help please with printing $_POST array « PHP Programming Language « IT news, forums, messages
Re: Newbie - Help please with printing $_POST array

Posted by Dynamo on 05/18/06 17:27

Many thanks for your time David. I have however opted to use Kimmos code.
Nothing personal but he does mention that in html 4.01 that numbers should not
be used in variable names which I was doing.

Kind Regards
Dynamo


In article <uSZag.67292$_e3.16547@fe74.usenetserver.com>, David Haynes says...
>A trick when using checkboxes is to use a hidden field to record the
>'off' value, then have the checkbox.
>
>For example:
><?php
>foreach( $keys as $key ) {
>?>
><input type="hidden" name="<?php echo $key;?>" value="OFF">
><input type="checkbox" name="<?php echo $key;?>">
><?php
>}
>?>
>
>If the checkbox is checked the value will be 'ON'; if the checkbox is
>not set, the value will be whatever you set the hidden value to. ('OFF'
>in the example)
>
>To delete as per what you have shown:
>
>foreach( $_POST as $key => $value ) {
> if( $value == 'ON' ) {
> $del = "delete from catalogue where id = $key";
> mysql_query($del) or die("...");
> }
>}
>
>-david-
>


--
NewsGuy.Com 30Gb $9.95 Carry Forward and On Demand Bandwidth

 

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

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