Image based on URL: POSSIBLE?

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
mhulse
Forum Commoner
Posts: 41
Joined: Fri Jun 11, 2004 12:50 am

Image based on URL: POSSIBLE?

Post by mhulse »

Hi,

I have ~six domain names that all point to the same server... For example:

Code: Select all

http://www.domain1.com ---\
http://www.domain2.com     |
http://www.domain3.com     |
http://www.domain4.com     |---> forwarded to --> http://gladstone.uoregon.edu/~myusernam ... /index.php
http://www.domain5.com     |
http://www.domain6.com     |
http://www.domain7.com ---/
Based on the above setup, is it possible to have a specific (banner) image displayed depending on the domain that the user typed in?

For example, lets say the user types in http://www.domain2.com, they would then see a bitmap banner that displays "domain2.com".

Maybe Javascript would be better for this...

Anyway, any suggestions would be cool!

Thanks in advance! Cheers!
<m />
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

what does:

Code: Select all

echo "<pre>"; print_r($_SERVER); echo "</pre>";
show?
User avatar
launchcode
Forum Contributor
Posts: 401
Joined: Tue May 11, 2004 7:32 pm
Location: UK
Contact:

Post by launchcode »

How do the domains work? For example when someone enters the URL domain1.com does their browser get redirected and eventually show the uoregon.edu address in the browser, or not?

Depending on this depends if it is easily possible or not.
mhulse
Forum Commoner
Posts: 41
Joined: Fri Jun 11, 2004 12:50 am

Post by mhulse »

Weirdan wrote:what does:

Code: Select all

echo "<pre>"; print_r($_SERVER); echo "</pre>";
show?
I will try that, I figured may be as simple as that... sorry, I am a noob...
How do the domains work? For example when someone enters the URL domain1.com does their browser get redirected and eventually show the uoregon.edu address in the browser, or not?
Yes, they all eventually show the uoregon address...

I could pay to have my domains masked, then they are just put within a main frame that always displays http://www.somedomain.com... even if you have navigated to sub-sub-pages... maybe it would work then...

Thanks for your help! :-)
mhulse
Forum Commoner
Posts: 41
Joined: Fri Jun 11, 2004 12:50 am

Post by mhulse »

Weirdan wrote:what does:

Code: Select all

echo "<pre>"; print_r($_SERVER); echo "</pre>";
show?

Code: Select all

Array
(
    &#1111;PATH] =&gt; /usr/local/bin:/usr/bin:/bin
    &#1111;TZ] =&gt; US/Pacific
    &#1111;HTTP_HOST] =&gt; gladstone.uoregon.edu
    &#1111;HTTP_CONNECTION] =&gt; keep-alive
    &#1111;HTTP_USER_AGENT] =&gt; Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/124 (KHTML, like Gecko) Safari/125
    &#1111;HTTP_ACCEPT] =&gt; */*
    &#1111;HTTP_ACCEPT_ENCODING] =&gt; gzip, deflate;q=1.0, identity;q=0.5, *;q=0
    &#1111;HTTP_ACCEPT_LANGUAGE] =&gt; en, ja;q=0.92, ja-jp;q=0.96, fr;q=0.88, de-de;q=0.85, de;q=0.81, es;q=0.77, it-it;q=0.73, it;q=0.69, nl-nl;q=0.65, nl;q=0.62, sv-se;q=0.58, sv;q=0.54, no-no;q=0.50, no;q=0.46, da-dk;q=0.42, da;q=0.38, fi-fi;q=0.35, fi;q=0.31
    &#1111;HTTP_COOKIE] =&gt; PHPSESSID=5073791297752f6e59848c9bbabb74c7
    &#1111;SERVER_SOFTWARE] =&gt; Apache/2.0.49 (Unix)
    &#1111;SERVER_NAME] =&gt; gladstone.uoregon.edu
    &#1111;SERVER_ADDR] =&gt; 128.223.142.14
    &#1111;SERVER_PORT] =&gt; 80
    &#1111;REMOTE_ADDR] =&gt; 128.223.210.40
    &#1111;DOCUMENT_ROOT] =&gt; /var/www/htdocs
    &#1111;SERVER_ADMIN] =&gt; webmaster@darkwing.uoregon.edu
    &#1111;SCRIPT_FILENAME] =&gt; /home1/myusername/public_html/www/index.php
    &#1111;REMOTE_PORT] =&gt; 52009
    &#1111;GATEWAY_INTERFACE] =&gt; CGI/1.1
    &#1111;SERVER_PROTOCOL] =&gt; HTTP/1.1
    &#1111;REQUEST_METHOD] =&gt; GET
    &#1111;QUERY_STRING] =&gt; 
    &#1111;REQUEST_URI] =&gt; /~myusername/www//
    &#1111;SCRIPT_NAME] =&gt; /~ myusername/www//index.php
    &#1111;PHP_SELF] =&gt; /~ myusername/www//index.php
    &#1111;argv] =&gt; Array
        (
        )

    &#1111;argc] =&gt; 0
)
It looks like I will have to set up domain masking with my DNS provider.

Thanks!
Cheers
<M />
Post Reply