Jump to content

My website has a lot of external links that need to be changed frequently. Hoping there's a way to "consolidate" the URL's in one place for easy updating.


Recommended Posts


I have a voting info website.  People click on cells in a large 50 U.S. state table, with 4 URL links per row.  That's 200 URL's.

Here's the code for each I'm using:  "onclick="window.location='http://alabamavotes.gov/AbsenteeVotingInfo.aspx?m=voters'">

Is there a way for the code in the HTML to be a "placeholder" to an external area where all the URL's "live" for easier updating?

Such as "onclick="window.location=AL-AV"  and somewhere else in the code (or even a table that "lives outside" the code in a separate document) there's something like

"AL-AV" =  http://alabamavotes.gov/AbsenteeVotingInfo.aspx?m=voters'"


Link to comment
Share on other sites

I'd do it client side with php.  either way you'd need to know something about php (server side) or javascript (client side).  else, the answer is probably beyond your current capabilities.  Someone else might have a different approach/opinion.

We're  happy to help as long as you try to ask informed questions.  The best hint I can give you is that you'll probably need to use some kind of loop.  so, read up on php loops specifically and php in general and try to rough out how you'd fit a php loop into your code.

First things first, though.  you'll need to set a localhost.  i'd use wampserver for that.  So, install wampserver (assuming you're using windows) and get back with us.  The step after that is familiarizing yourself w/ php.

This will be a leap worth taking.

Edited by niche
Link to comment
Share on other sites

Thanks.  I appreciate the confidence and the advice and that I should consider my current capabilities.

Since it's a voting website, the links don't actually need to be updated all that often.   But I'll definitely consider what you've advised.

Thanks again.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...