Challenging problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Challenging problem

Post by dude81 »

Hi,
This could be challenging.
Im working on a software which should publish feed urls. Now I want a central file where I can implement the business logic so that my various links will work. The business logic will be like Ill query the database and retrieve the url_id and other parameters of the url based on which my urls will output the data. So how can I do that. The software has rewrite rules restriction.

In short , one file being called by multiple urls, and file outputs the data in according to url. Otherwise to say one script will be called when multiple urls contain some server name plus with one extrastring.

Code: Select all

http://server_name/extrastring/anythingfromhere

and extrastring index.php has the code written it so that all the urls with

Code: Select all

http://server_name/extrastring/one1
http://server_name/extrastring/kate_winslet/
http://server_name/extrastring/tom_hanks/

all of the above urls script executed in extrastrings index.php
Kindly throw some of your ideas that how one can implement this.



Thanks
Last edited by dude81 on Tue Feb 20, 2007 8:14 am, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'm not understanding. Please explain more.
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post by dude81 »

posted with seconds difference. I updated kindly see it now
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

sounds like you want a MVC architecture - google up a tutorial
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post by dude81 »

No, I heard a solution, I was meaning a use case of rewrite rules in Apache.
like
any page which comes of any of the following form

Code: Select all

http://localhost/app/a/xyz
http://localhost/app/a/abc
http://localhost/app/a/123
will be redirected to

Code: Select all

http://localhost/app/a/index.php
That is all. I found it is a use case of rewrite rule :)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

We have a lot of threads on mod_rewrite doing such things.. it has nothing to do with PHP.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Kieran Huggins wrote:sounds like you want a MVC architecture - google up a tutorial
Actually sounds like he wants a Front Controller with mod_rewrite and some kind of URL router/mapper. The MVC implementation is conceptually after the dispatch.
(#10850)
Post Reply