This is a discussion on "Changing URLs dynamically - is this possible?" within the Web Page Design section. This forum, and the thread "Changing URLs dynamically - is this possible? are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Changing URLs dynamically - is this possible?
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Changing URLs dynamically - is this possible?
I've been puzzling this little problem for a week or so, and I have a feeling it can be done somehow but I'm not quite sure how.
What I'm wanting to do is have a number of images on one of my domains that are hotlinked to by a number of other domains. I want to be able to switch the image on all of the other domains that link to that image/url, without having to delve into the code every time I want to do it (I'm thinking something like a form and a just press the button to change it kind of arrangement). I considered client-side javascript and DOM, but as far as I can see while I could use that to change an image locally, to display an image, that would have no effect on the actual url, so I then moved to thinking server-side. So then I tried php includes and with the help of a friend figured out how to use a php include to change the displayed image, but, the big problem with that is again that while I can change the displayed image, that also changes the url and of course because I'm hotlinking the images the url has to be the same. I have a nasty feeling the answer to this is somehow gonna be either database related (not good news - one of my hobbies is b0rking MySQL databases <hehe>) or involve some programming trickery that's beyond me, but this is puzzling me because I'm sure it can be done - I just can't figure out how. Any ideas anyone? |
|
|
|
|||
|
Re: Changing URLs dynamically - is this possible?
CAn you provide some links to the pages you are talking about?
|
|
|||
|
Re: Changing URLs dynamically - is this possible?
No, I haven't got anything set up yet - it's a theoretical "can this be done?" at this stage. Basically I just want to be able to put the images on a page somewhere (not necessarily that's linked to the rest of the site or anything) that I can go to and change the image.
|
|
|||
|
Re: Changing URLs dynamically - is this possible?
You could use Javascript to do this
You would have to have one js file for each picture I believe but a DB would be the easiest route |
|
||||
|
Re: Changing URLs dynamically - is this possible?
Why do you need a js file for each picture?
Just give the image an id and then on each link you can just change the source of the image:- document.getElementById("myimage").src="newimage.j pg"
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
|||
|
Re: Changing URLs dynamically - is this possible?
I was thinking
|
|
||||
|
Re: Changing URLs dynamically - is this possible?
why can't u just upload a new picture with the same name to replace the old one each time you want to change it?
|
|
|||
|
Re: Changing URLs dynamically - is this possible?
Quote:
With regard to your original post, you can place an image at one domain and reference that image from any number of other domains. Image bandwidth thiefs do it all the time. You might want to control just which domains have access to the image. |
|
|||
|
Re: Changing URLs dynamically - is this possible?
I suppose I could do. It was just one of those "what ifs" and I wondered if there was a way to do it without ftping of delving into code or anything.
|
![]() |
| Tags |
| changing, urls, dynamically, possible |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Displaying URLs | trevorc | Web Page Design | 2 | May 13th, 2007 23:42 |
| Dynamically changing iframe position | sadanandam | JavaScript Forum | 0 | Jul 24th, 2006 12:50 |
| PHP Iframe URLS | Darkwoods | PHP Forum | 0 | May 16th, 2006 11:08 |
| Encrypting urls in .net | Sabarish_s | ASP.NET Forum | 5 | Mar 31st, 2004 06:40 |