Posted by Noodle on 07/24/06 08:07
ChristoinSD wrote:
> I am new to PHP and coding.
>
> I have several domains that use splash pages that point to my main
> site:
> i.e. http://www.mysite.com/index.php.
>
> How do I replace an image, named "Logo.gif" on the main page
> "http://www.mysite.com/index.php" with the image named "logo.gif"
> from the URL splashpage, " http://www.mysite.com/SanDiego/"
>
> Both images are named logo.gif because the PHP script references
> logo.gif through the script in too many places...It is just easier to
> keep the name logo.gif
>
> Problem:
> If a user is on the San Diego page and clicks to the main page I want
> the user to feel that the site is all about SanDiego.
> If a user is on the Los Angeles page and clicks to the main page I want
> the user to feel that the site is all about Los Angeles.
>
> Hence the site and database will still be the same..I just want them to
> feel the experience is personalized for their city and this will be
> determined by changing the logo.gif.
>
> I am using an image named logo.gif that will display SanDiego for the
> San Diego page
> I am using an image named logo.gif that will display Los Angeles for
> the Los Angeles page
>
> I have seen some PHP code that uses php echo $picture I am not sure if
> this will work...
>
> Can you please provide the code....This would be greatly appreciated.
Is this what you were thinking of?
<?php
switch ( $_SERVER["SCRIPT_URL"] ):
case '/SanDiego/':
case '/SanDiego/index.php':
$img_url = "path/to/san/logo.gif";
break;
default:
$img_url = "path/to/la/logo.gif";
break;
endswitch;
echo "<img src=\"$img_url\" alt=\"Splash Image\"/>"
?>
Navigation:
[Reply to this message]
|