LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[CLUG] TECH/PHP question

[CLUG] TECH/PHP question

Fixer fixer at vigilante.net
Tue Oct 23 22:00:53 IST 2001


Pay no attention to the man behind the curtain...I cleared up my confusion.

I was confusing the array() function with it's use or my assumed need of 
it's use in
the name="xxx" portion.  I am clear now:

<input type="text" name="myrow[<? =$t; ?>][caption]" value="<? =$ccaption; ?>">

$myrow[1]["caption"] = "this is a caption"



At 21:51 23/10/2001 +0100, Fixer wrote:
>I think I realized that just after I hit send...if I explicitely name the 
>array key, it will hold it's position, so to speak...
>
>now, how would I set the name field in an html form that is within a for loop?
>
>
><?
>
>$configtext = file ($configfile);
>
>   for ($t=0;$t<count($configtext);$t++) {
>     list($cfile,$ccaption)=explode("}",$configtext[$t]) ;
>?>
><input type="text" name="<? =$t; ?>[caption]" value="<? =$ccaption; ?>">
>
>
>then I just walk thru arrays 1 thru count($configtext) and do what I will 
>with them...
>
>look right?
>
>or should the name be
>
><input type="text" name="array[<? =$t; ?>][caption]" value="<? =$ccaption; 
>?>">
>
>
>At 21:36 23/10/2001 +0100, ad at m.beecher.net wrote:
>> > For example, if there is no caption text for image 5, the image array
>> > will only have 9 items...of if I flipped the array, I would end up with
>> > the delete value in the caption slot.
>> >
>>Why would you only have 9 items in the image array (and surely you mean the
>>caption array)? If you number them specifically in the form -
>>name="image[$i]" - the empty elements will be just that, empty elements. You
>>can still associate them by number.
>>
>>adam
>
>
>--
>fix.er \'fik-s*r\ n : one that fixes : as : one that intervenes to
>    enable a person to circumvent the law or obtain a political
>    favor : one that adjusts matters or disputes by negotiation
>
>
>_______________________________________________
>Cork maillist  -  Cork at linux.ie
>http://www.linux.ie/mailman/listinfo/cork


--
fix.er \'fik-s*r\ n : one that fixes : as : one that intervenes to
    enable a person to circumvent the law or obtain a political
    favor : one that adjusts matters or disputes by negotiation





More information about the Cork mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell