Computing.Net > Forums > Web Development > Include and change image

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Include and change image

Reply to Message Icon

Name: sypder
Date: July 8, 2004 at 17:05:07 Pacific
OS: N/A
CPU/Ram: N/A
Comment:

There are several organizations that want to have the content of http://www.cancereducation.com/cancersyspagesnb/a/mmrf/mm0204/index.cfm?rid=36 on their website. They would like to be able to change the "Multiple Myeloma Research Foundation" logo to their logo. Currently, cancereducation is making different pages for everyone, and changes have to be done many times. What makes this difficult for me is that they want their logo to remain as the user browses the entire site. In order to included these pages directly on their site I was hoping to do some sort of perl/PHP include and then just direct the image to a different image. Any suggestions? I really hope this question is clearly stated.



Sponsored Link
Ads by Google

Response Number 1
Name: Don Arnett
Date: July 9, 2004 at 09:51:28 Pacific
Reply:

From what I've seen of PHP so far, it works similarly to JSP. I'll tell you how'd I do this in JSP and I believe that you can do the same thing with PHP.

You would use a PHP variable to hold the image URL, then when you want to display the image, you use the variable rather than the actual URL. Again, based upon my JSP experience, this image variable bit of code my be the only PHP you have on the whole site. The rest could remain normal HTML/Javascript etc. Your filenames will change from .html to .php tho.

Now you have to figure out how to set the image variable. One way would be to manually set it when you copy a set of the pages to each website. You'd put the variable assignment in a file and include that file at the top of each webpage that has the logo. Then when you get a new 'client', you edit the file with the variable assignment before copying the pages to their site.


0

Response Number 2
Name: Don Arnett
Date: July 9, 2004 at 09:57:35 Pacific
Reply:

As I finished typing the above, I remembered an easier way that I've used before.

In the code just name the image something generic, like "logo.gif".

Then each site would just rename thier image file to "logo.gif".

Walla! Nice & easy, chucky cheesy!

One problem that you'll have to deal with tho, is that logos are not all the same size. And sometimes it's not easy to shrink, expand, etc a logo to fit a predetermined space.

On the link you provided, I see two copies of the logo. The lower one probably isn't a problem, because if it was replaced by another image that was twice as big in both height and width, it would just slide the text down farther. Not a big deal.

But the log at the upper right could be a problem because putting a bigger logo there will mess up the formatting.

Maybe that logo can be removed.



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


parse path from referer's... Web Page size



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Include and change image

CSS positioning & dimensions (?) www.computing.net/answers/webdevel/css-positioning-amp-dimensions-/2810.html

HTML Images www.computing.net/answers/webdevel/html-images/2535.html

Guestbook spam, security image? www.computing.net/answers/webdevel/guestbook-spam-security-image/2868.html