Changing URLs dynamically - is this possible?

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.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old May 16th, 2006, 18:03
Junior Member
Join Date: May 2006
Location: UK
Age: 35
Posts: 24
Thanks: 0
Thanked 1 Time in 1 Post
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old May 16th, 2006, 18:07
Up'n'Coming Member
Join Date: Apr 2006
Location: Missouri
Age: 32
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Changing URLs dynamically - is this possible?

CAn you provide some links to the pages you are talking about?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old May 16th, 2006, 18:13
Junior Member
Join Date: May 2006
Location: UK
Age: 35
Posts: 24
Thanks: 0
Thanked 1 Time in 1 Post
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old May 16th, 2006, 18:28
Up'n'Coming Member
Join Date: Apr 2006
Location: Missouri
Age: 32
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old May 16th, 2006, 18:39
Rob's Avatar
Rob Rob is online now
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,157
Blog Entries: 7
Thanks: 26
Thanked 19 Times in 16 Posts
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"
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old May 16th, 2006, 19:26
Up'n'Coming Member
Join Date: Apr 2006
Location: Missouri
Age: 32
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Changing URLs dynamically - is this possible?

I was thinking
Code: Select all
<script type="text/javascript" src="www.webserver.com/image1.js"></script>
I am thinking your way might be better
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old May 16th, 2006, 21:04
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old May 16th, 2006, 22:25
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Changing URLs dynamically - is this possible?

Quote:
Originally Posted by benbacardi
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?
You can if you keep the dimensions the same or do not specify them in the first place.

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old May 16th, 2006, 23:31
Junior Member
Join Date: May 2006
Location: UK
Age: 35
Posts: 24
Thanks: 0
Thanked 1 Time in 1 Post
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
changing, urls, dynamically, possible

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 17:22.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42