By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,134 Members | 1,195 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,134 IT Pros & Developers. It's quick & easy.

Call function based on pathname

drhowarddrfine
Expert 5K+
P: 7,435
I haven't been doing any real coding in a long time so I'm looking for someone to double check my line of reasoning, if you want to call it that.

I have a server that will supply a web page path name, such as /page1/page2/mypage. Based on that, I need to call the function that will generate that web page, mypage(). I guess the best way to do that is just examine the path supplied and have a lookup table point to the correct function. I don't know if it's worth generating a hash table or not but is there a better way or am I on the right track?
Dec 21 '06 #1
Share this Question
Share on Google+
2 Replies


100+
P: 1,646
I haven't been doing any real coding in a long time so I'm looking for someone to double check my line of reasoning, if you want to call it that.

I have a server that will supply a web page path name, such as /page1/page2/mypage. Based on that, I need to call the function that will generate that web page, mypage(). I guess the best way to do that is just examine the path supplied and have a lookup table point to the correct function. I don't know if it's worth generating a hash table or not but is there a better way or am I on the right track?
Sounds good to me
Dec 21 '06 #2

Banfa
Expert Mod 5K+
P: 8,916
A hash table is probably only worth it if you are talking about 100s of pages.
Dec 21 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.