Need advice on how to proceed

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
snicolas
Forum Commoner
Posts: 97
Joined: Tue Nov 09, 2004 8:32 am

Need advice on how to proceed

Post by snicolas »

Hi all,

I am asked to create a "redirection" page for a company who has X clients.

The company is called "the company" and is at
http://www.thecompany.com

This company has 50+ clients and would like to create a specific and ddifferent page for all of them.

they are looking to give a url to their clients that will display that page:

like http://www.thecompany.com/clients/?57

57 being the id of the client.

How can i get the value "57" from my index.php page situated in the clients folder?
this will allow me to display specific content for each id.

thx

s
User avatar
thomas777neo
Forum Contributor
Posts: 214
Joined: Mon Mar 10, 2003 6:12 am
Location: Johannesburg,South Africa

Post by thomas777neo »

Normally the best thing to use a template based system. Or some sort of page creating wizard.

It depends on what detail should be shown on the clients page. It the detail is all the same, use a template page. If the client can modify the page as he likes it, then you would have to have a wizard or tool of some sort.

Rather have the client log in aswell (more secure).

The idea is to make the site as manageable as possible. For example, if a new client joins, you don't want to go and create a new page for that client.

Another thing to consider is storing you clients in a database. This makes the template idea pretty easy to pull off. Becuase you can store the page detail for the client aswell, that can be modified by him.

So in the end you can either have a search or establish who the client is by him logging on. In both cases you can identify the clients id (57). Then simply send the id to the template page. Then retrieve the page detail from the database acording to the client id.
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

you can do this:

http://www.thecompany.com/clients/?c=57

and then use $_REQUEST['c']

if you need to use:

http://www.thecompany.com/clients/?57

you might have to parse the $_SERVER['QUERY_STRING']
snicolas
Forum Commoner
Posts: 97
Joined: Tue Nov 09, 2004 8:32 am

Post by snicolas »

thx andre...that helped.

s
AGISB
Forum Contributor
Posts: 422
Joined: Fri Jul 09, 2004 1:23 am

Post by AGISB »

Please do yourself a favour and look into security issues of the approach you describe. There are many many sites out there where people can just change the url and get access to other accounts.

If you give someone a url with id=57 he will surely try to use id=55 or id=58 also. This is not easy to solve without a complex authentication system.
Post Reply