Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Global replace - Is it doable?

Status
Not open for further replies.

josel

Programmer
Joined
Oct 16, 2001
Messages
716
Location
US
Howdy dudes!

Given a DWUD site with lots of hard coded URLs. I would like to:

1. Use application variable
2. Replace all instances of hard coded URLs for variables

So, the questions are:

1. How and where can you define application variables?
2. How and where can you globally replace all URLs?

Templates are written on ASP format. There are directories and sub-directories.

Thank you all in advance for you time and assistance!

Regards;


Jose Lerebours

KNOWLEDGE: Something you can give away enlessly and gain more of it in the process! - Jose Lerebours
 
Hi Jose,

You can define application variables in your global.asa file which, if not residing in your directory should be within your webroot somewhere. Information about the use of this can be found at:


I would be tempted to create a backend database table dedicated to your URLs and then create a data link to each page form that database. YOu can then set up a parallel form that will allow you to administer the database ie add, update or delete URLs. If this is wide of the mark please let us know and offer some further info.

M
"There are 3 kinds of people; those that can count and those that can't"
 
mlawson,

Thanks for reponding and the above listed links. I checked the links out and they appear to be very good source for a newbie like me!

As per globally changing all instances of a given string, is there anything you can contribute with?

Regards;


Jose Lerebours

KNOWLEDGE: Something you can give away enlessly and gain more of it in the process! - Jose Lerebours
 
Oooh, you could read up about the VBscript "replace" command. I have a URl somewhere for it, I'll dig it out and report back

M "There are 3 kinds of people; those that can count and those that can't"
 
Find and replace options include

Current Document
Entire Local Site
Selected Files in Site
Folder(navigate and select required folder)

Search for options

Source Code
Text
Text(advanced)
Specific tag The secret of life is honesty and fair dealing. If you can fake that, you've got it made.
Groucho Marx (1895-1977)
 
oh yeah that find and replace is probably the best feature Macromedia put into the Dreamweaver line.

Just a word of caution - if you are vague like you search source code on http:// to replace with whatever - it will not only look for http:// but it will replace irregardless of if it is by itself or a url you really do need.

And you may want to redesign the table (if you have a table) containing the links - do as the guys suggested above - but take it a step further, and repeat region. Saves some time, energy, and will reduce pollution upon the earth.

Just kidding on the last part.

"Insert witty remark here"

Stuart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top