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

Hello,

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'"

Thanks.

Link to post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...