| View previous topic :: View next topic |
| Author |
Message |
NeilF
Joined: 23 Mar 2005 Posts: 5
|
Posted: Wed Mar 23, 2005 12:35 pm passing a variable with html in the same page |
|
|
|
Hi,
I did a search but did not find the answer to what I am looking for.
I have a web page that contains downloadable files. The base URL is the same for all of the files. What I want to do is use a variable for the base URL and somewhere near the top of the page enter what the URL is. This would be hardcoded as the URL changes. I don't want to have to hard code the URL for all of the files. Can this be done in HTML without a scripting language?
Neil |
|
itunes66
Joined: 09 Mar 2005 Posts: 184
|
Posted: Wed Mar 23, 2005 1:45 pm |
|
|
|
are you wanting all links to go to a portion of a url and part is changed
e.g.
<base href="urlhere/folderhere/">
<a href="picname"> |
|
NeilF
Joined: 23 Mar 2005 Posts: 5
|
Posted: Wed Mar 23, 2005 3:18 pm |
|
|
|
Hi ituness66,
What I basically have is
<A href="http://www.mySite.com/rpms/apache2-2.0.53-nl.i586.rpm">apache2-2.0.53-nl.i586.rpm</A>
what I want is
<A href=variable"/rpms/apache2-2.0.53-nl.i586.rpm">apache2-2.0.53-nl.i586.rpm</A>
And then declare the varible somewhere that will hold the http://www.mySite.com as this is the part that is subject to change.
Neil |
|
itunes66
Joined: 09 Mar 2005 Posts: 184
|
Posted: Wed Mar 23, 2005 3:22 pm |
|
|
|
| what do you mean by variable |
|
NeilF
Joined: 23 Mar 2005 Posts: 5
|
Posted: Wed Mar 23, 2005 3:40 pm |
|
|
|
Somewhere in the page I want to say that myURL = "http://www.mySite.com"
Then I want to append it to the A href statement to make something that resemebles this
<A href=myURL+"/rpms/apache2-2.0.53-nl.i586.rpm">apache2-2.0.53-nl.i586.rpm</A>
A variable is a name that you give to an imaginary space that holds information that can be called when you need it. I'm not sure if HTML is capable of providing a simple variable to hold a URL or not. That is why I asked the question here.
I can develop the page with php but would prefer to just keep it HTML
Neil |
|
itunes66
Joined: 09 Mar 2005 Posts: 184
|
Posted: Wed Mar 23, 2005 4:48 pm |
|
|
|
<base href="ur web adress here">
<a href="/rpms/apache2-2.0.53-nl.i586.rpm"> |
|
degsy

Joined: 23 Feb 2005 Posts: 2440 Location: North East, UK
|
Posted: Wed Mar 23, 2005 6:10 pm |
|
|
|
| unless you are using server-side scripting then go with the base href that has already been posted. |
|
NeilF
Joined: 23 Mar 2005 Posts: 5
|
Posted: Wed Mar 23, 2005 6:23 pm |
|
|
|
Won't the base url tag affect all hyperlinks in the page? If that is the case then I can't use it. Some hyperlinks on the page will have a hardcoded hyperlink.
Neil |
|
degsy

Joined: 23 Feb 2005 Posts: 2440 Location: North East, UK
|
Posted: Wed Mar 23, 2005 6:26 pm |
|
|
|
then use Server-Side scripting  |
|
NeilF
Joined: 23 Mar 2005 Posts: 5
|
Posted: Wed Mar 23, 2005 7:06 pm |
|
|
|
Hi degsy,
If I wanted to use server side scripting I wouldn't have asked the question. So far none of the answers have answered my original question which was "Can a variable be passed in a HTML page?"
Neil |
|
degsy

Joined: 23 Feb 2005 Posts: 2440 Location: North East, UK
|
Posted: Thu Mar 24, 2005 7:09 am |
|
|
|
| Then no. HTML is not a scripting language that can pass variables. |
|
|