HTML Tutorial


 /help/HTML Help Forum   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
passing a variable with html in the same page
Post new topic   Reply to topic    HTML Help Forum -> General HTML
View previous topic :: View next topic  
Author Message
NeilF



Joined: 23 Mar 2005
Posts: 5

PostPosted: Wed Mar 23, 2005 12:35 pm     passing a variable with html in the same page Reply with quote

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

PostPosted: Wed Mar 23, 2005 1:45 pm     Reply with quote

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

PostPosted: Wed Mar 23, 2005 3:18 pm     Reply with quote

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

PostPosted: Wed Mar 23, 2005 3:22 pm     Reply with quote

what do you mean by variable
NeilF



Joined: 23 Mar 2005
Posts: 5

PostPosted: Wed Mar 23, 2005 3:40 pm     Reply with quote

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

PostPosted: Wed Mar 23, 2005 4:48 pm     Reply with quote

<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

PostPosted: Wed Mar 23, 2005 6:10 pm     Reply with quote

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

PostPosted: Wed Mar 23, 2005 6:23 pm     Reply with quote

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

PostPosted: Wed Mar 23, 2005 6:26 pm     Reply with quote

then use Server-Side scripting Wink
NeilF



Joined: 23 Mar 2005
Posts: 5

PostPosted: Wed Mar 23, 2005 7:06 pm     Reply with quote

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

PostPosted: Thu Mar 24, 2005 7:09 am     Reply with quote

Then no. HTML is not a scripting language that can pass variables.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum -> General HTML All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial