I'm an avid user of both and for all intents and purposes, you're right. PHP
loses it's simplicity in the fine detail controls it offers, while CF makes
rapid development easy and simple.

They both have their ups and downs and even though the example you mention
is true, there are numerous different ways of doing this with PHP that make
it a lot more easy...

Cheers,

!k

-----Original Message-----
From: Andy Matthews [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 06, 2006 2:07 PM
To: CF-Talk
Subject: Simple thing in CF is painfully clunky in PHP

I just found out something about PHP that makes me thankful that I don't use
it.

Someone on another list asked a question about multiple checkboxed with the
same name. For example:

<INPUT NAME="ck" TYPE="CHECKBOX" VALUE="example1">example1<BR />
<INPUT NAME="ck" TYPE="CHECKBOX" VALUE="example2">example2<BR />
<INPUT NAME="ck" TYPE="CHECKBOX" VALUE="example3">example3<BR />

In Coldfusion, if you check all three of these boxes, you'd wind up with a
form variable named "ck", with a value of "example1,example2,example3".

Apparently in PHP, with a setup as above, you'd only wind up with the LAST
value in that set "example3". To gain access to all values in PHP you have
to set the name of the form element to "ck[]", which is the shortcut for
creating an array.

<input name="ck[]" type="checkbox" value="1">example1<br />
<input name="ck[]" type="checkbox" value="2">example1<br />
<input name="ck[]" type="checkbox" value="3">example1<br />

Then do stuff with it to get it into list format:
$ck='';
foreach($_POST[ck] as $item) {
        $ck .=$item."|";
}

This just makes me unbelievably thankful for Coldfusion's simplicity.

<!----------------//------
andy matthews
web developer
certified advanced coldfusion programmer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255847
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to