You are here: Re: Mod_Rewrite / Regex to PHP URL « PHP Programming Language « IT news, forums, messages
Re: Mod_Rewrite / Regex to PHP URL

Posted by Kimmo Laine on 02/15/07 07:49

"Dr. No" <no@no.no> wrote in message
news:qKMAh.14804$O02.2869@newssvr11.news.prodigy.net...
>I am new to using mod_rewrite and am trying to rewrite a URL to pass values
>to my script so that:
>
> http://www.myclient.com/everything/animals/mammals/cats
>
> is transformed into
>
> http://www.myclient.com/index.php?nav[0]=everything&nav[1]=animals&nav[2]=mammals@nav[3]=cats
>
> Specifically, I am looking for an n-ary solution to this problem. I know
> how to do it for a discrete number, but how do I do this transformation
> when the number of variables to go into the nav array is unknown, and how
> do I generate the index number? Can any experience mod_rewrite gurus point
> me in the right direction. I'm sure this is a common design pattern.


Just use empty brackets: nav[]=everything&nav[]=animals&nav[]=mammals, php
will understand this and create the index numbers for you.

--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti pδivittyvδ nettisarjis
spam@outolempi.net | rot13(xvzzb@bhgbyrzcv.arg)

 

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

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация