|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Article Discussion: Simple PHP Templates With PatTemplate
Simple PHP Templates With PatTemplate
Phew, finally able to visit devarticles.com again.. The DNS server I was using never updated itself.. so all I got was a blank page.. oh well.. ![]() If you have any questions or comments for this article or topic, please post them here. ![]() You can read the article here .
__________________
Best Regards, Håvard Lindset |
|
#2
|
|||
|
|||
|
Havard,
I'm having a little trouble with alternating my row colors.... I'm starting to lose my mind! Here's the code: Table PHP Code:
Script PHP Code:
Any help would be appreciated. I only have it displaying in one color. Any ideas?
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
|
#3
|
|||
|
|||
|
Hi Frank,
I've had problems with that too.. A solution might be to dynamically generate an array with all of the values, then use the addVars() function.. the array has to be an associative array like this: array(CLIENTID => array(1, 2, 3), CLIENTNAME => array("Client1", "Client2", "Client3") ); Hope it works out for you ![]() |
|
#4
|
|||
|
|||
|
Quote:
I'm not sure if I know what you mean... What would replace "Client1", "Client2", etc? Are those the hardcoded values, or variables? I'm somewhat in a bind... using the templates has made certain aspects so much easier, but in other respects, it's a pain in the a*s! :PAny help would be great! TIA! |
|
#5
|
|||
|
|||
|
Here's something you can do.. just an example
PHP Code:
I just had to test it myself before I posted it here ![]() Last edited by Lindset : July 6th, 2002 at 03:35 PM. |
|
#6
|
|||
|
|||
|
Quote:
Does that assign $row['username]' to the 2nd [], and so on? I get too confused when dealing with multi-dimensional arrays.... |
|
#7
|
|||
|
|||
|
If you execute these lines of code:
$array['somename'][] = "Yes"; $array['somename'][] = "Sir"; $array['blah'][] = "Test"; $array['blah'][] = "Me"; The value of: $array['somename'][0] would be "Yes" $array['somename'][1] would be "Sir" $array['blah'][0] would be "Test" $array['blah'][1] would be "Me" When you use [] it will be applied at the end of the array.. |
|
#8
|
|||
|
|||
|
Here's the code that would make the alterning colors work for you.
PHP Code:
It should work.. ![]() |
|
#9
|
|||
|
|||
|
Ahh... Okay, so in the case of:
PHP Code:
It's taking the value of "username" and "password" in each row, and assigning it to "$return['username'][0], $return['password'][0]" and "[1][1]" for the next row and so on? Now when you called: PHP Code:
Does it automatically assume ALL arrays with the prefix "$return" to replace those values? |
|
#10
|
|||
|
|||
|
Quote:
Correct ![]() |
|
#11
|
|||
|
|||
|
Quote:
BEEEEUUUUUUTTTTTIIIIIIFFFFFUUUUULLLL!! It worked... i understand that a lot more now! So by using multi-dimensional arrays, I can store the value of each row's column into a separate element? Thank you for the help! I would have gone bald soon! ![]() |
|
#12
|
|||
|
|||
|
To everyone that's interested in patTemplate:
http://www.php-tools.de/xena/apps/f...aarticleid=---- |