I'm trying to create a sort of community thingy with php. Basically, each user will have their own area on my domain. Now the prob is that they will all share the same mysql db and I use a company_id to determine who is who.
I could quite easily work this with http://www.domain.com/index.php?companyid=1
, but I want it to be completely transparent, so the URL will be something along the lines of http://www.domain.com/company1/index.php
So I'd like to extract the URL to a string and parse it, getting 'company1' (or whatever) out, then look that up in a table to get the company id. Probably not the most efficient way of doing things, but if anyone can help me out here, I'd be very pleased