473,411 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Displaying an image based on URL origination-URL Redirect

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.

Jul 24 '06 #1
1 2041

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\"/>"
?>

Jul 24 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Sahil Malik [MVP] | last post by:
I am looking for suggestions on a software that can display an Org. Chart in a web based environment. The server runs .NET (2.0), and I have to add that the org chart must work on...
4
by: MrL8Knight | last post by:
Hello, I am trying to build a simple php form based shopping cart using a cookie with arrays. I need to use 1 cookie because each order will have over 20 items. With that said, I realize I need to...
1
by: esparkman | last post by:
Hey guys, Kinda stuck in a rut on this one. I'm designing a online stats tracking web app for the game battlefield 2. I want to display the players rank represented by an image. That is in turn...
4
by: bissatch | last post by:
Hi, I have launched my new website and having viewing it on the Mac Internet Explorer, have found that it isnt displaying my background-image property. Is this a common bug / occurance? How are...
1
by: rascalking | last post by:
Hello, So I've read many forums that explained how to get an image out of SQL Server database and display it. I used an alternate .aspx page to retrieve the image and write it back as binary...
1
by: i.sobha | last post by:
Hi, I tried retreiving an image from an access data base and display it to the asp page . The code is shown below. But the same is not working. Can someone provide me with some valuable...
1
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being...
11
by: Usenet User | last post by:
..NET 1.1/2.0 I have a need to display high-resolution scrollable images in a .NET application (Windows Forms). One well known solution is to create a Panel with AutoScroll set to "true" and...
4
by: shahidrasul | last post by:
i display a pic on picture box and then i want to display another pic after some seconds but problem is that first image is not displaying only display 2nd image 1... display first picture from...
3
by: mvijayrkumar | last post by:
Hi to all.... Guys pls help me..... I have an image issue in RLDC while hosting my project on server.The image displays or works fine with the local system.But when hosted on server,both the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.