Forum Moderators: open
Our ads department schedules ads to something like http://example.com/path/to/the/index.ext?article.xml.
I'm trying to determine the best way to write this old directory to the ad code in the new pages, which would be something like http://example.com/index.ext?subject?article.xml
I think I'd need to create a hashtable or something tha pairs the old directory path with the new subject string.
something like this...
subject1 = /path/to/theoldpage/
subject2 = /path/to/anotheroldpage/
subject3 = /path/to/yetanotherpage/
...where subject1, 2, and 3 are the string in the new uri.
I need to grab that and then just document.write it somewhere-- *I think.*
Can anybody help me get started with this? I'm sort of stumped as to where I should start with it.
Thanks!
[edited by: encyclo at 1:48 am (utc) on Jan. 8, 2007]
[edit reason] switched to example.com [/edit]
I just need to write the old page's URI into the ad code in the new page.
But that's not really important. What I NEED to do to accomplish this is take a string from the NEW uri and based on that, write the OLD uri. I realize that ideally, there would be a database to do this with, but it's just not in the cards right now. A hash table or XML file could be done however. Can anybody help get me started?
If the page's URI contains a given string, write another string. The values will come from an array, like this (I think I've got this right).
var oldindex = new Array()
oldindex[baseball] = "/sports/baseball/index.html"
oldindex[football] = "/sports/football/index.html"
oldindex[soccer] = "/sports/soccer/index.html"
oldindex[hockey] = "/sports/hockey/index.html"
So, if the new page is [website.com...] I want to write "/sports/baseball/index.html" somewhere. Anybody?