Hi,
I have a form that has something like this:
input type=checkbox name=url[] value='http://somesite' checked
a href='http://somesite' target=asomesite/a
brinput type=text name=txt[] size=75 value='some desc'
input type=checkbox name=url[] value='http://somesite1' checked
a
[snip]
These values will be entered into the database so I need proper
matching
pairs of URL and TXT
[/snip]
for($i = 0; $i count($url); $i++){
if(( != $url[$i]) ( != $txt[$i])){
//it is OK to put into database
} else {
//it ain't OK
}
}
--
PHP General Mailing List
You're close, but you want to use multidimensional arrays. So something
like:
input type=checkbox name=data[0][url] value='http'
input type=text name=data[0][txt] size=75 value='desc'
input type=checkbox name=data[1][url] value='http'
input type=text name=data[1][txt] size=75 value='desc'
input
-Original Message-
From: Ryan A [mailto:[EMAIL PROTECTED]
Sent: Friday, November 05, 2004 11:28 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Multiple checkboxes and multiple textboxes
Hi,
I have a form that has something like this:
input type=checkbox name=url[] value='http
Nope,
This didnt work, it just chops off the last x depending on how many were
selected.
Thanks,
Ryan
On 11/5/2004 8:46:27 PM, Jay Blanchard ([EMAIL PROTECTED])
wrote:
[snip]
These values will be entered into the database so I need proper
matching
pairs of URL and TXT
[/snip]
for($i
[snip]
This didnt work, it just chops off the last x depending on how many were
selected.
[/snip]
Hmreally? I was just able to do this with nary a problem. Chops
off? Can you just echo out the results?
for($i = 0; $i count($url); $i++){
if(( != $url[$i]) ( != $txt[$i])){
Hi Jay,
I modified your code slightly because I am working with 152 rows and the
output would be a _lot_
This is how i modified it:
$url=$_POST['url'];
$txt=$_POST['txt'];
for($i = 0; $i count($txt); $i++){
if(( != $url[$i]) ( != $txt[$i])){
//echo $url[$i] . nbsp;. $txt[$i] .
:28 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Multiple checkboxes and multiple textboxes
Hi,
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
8 matches
Mail list logo