I have about 100 sub web sites under my domain, example: domain.com/England, domain.com/Denver and I adding more, I need my main web site to recognize where the customer came from (which sub domain) and send the form information via email to that office. Let's say someone goes to my England web site and is refereed back to my main site, where my submit forms are. Is there a way to carry forward the email address for the customer rep in England so when the customer submits a form from my main site it will go straight to my England office email. I could replicate my entire site 100 times but then if I needed to change something I would have to change 100 web site.

This is probably simple to answer, I have knowledge in other areas but this is all new, if yo have an answer can you make it simple to understand.

Recommended Answers

All 2 Replies

The easiest way to do this is with $_SERVER; This will tell the server what page referred them to that page by.
Because http is a stateless protocol, this can be easily manipulated though. Another way would be to set a variable on a previous page that could be passed like:
<input type='hidden' name='referrer' value='England' /> and then access the variable from the mail form.

The easiest way to do this is with $_SERVER; This will tell the server what page referred them to that page by.
Because http is a stateless protocol, this can be easily manipulated though. Another way would be to set a variable on a previous page that could be passed like:
<input type='hidden' name='referrer' value='England' /> and then access the variable from the mail form.

I agree with u buddylee, there's one more option for this case, you can sent ur "subdomain" variable through GET method.
example : linktomydomain.com?location=England
then u can take $location value in your main page.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.