473,386 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Using a Variable in an <a href statement

I would like to be able to open a link utilising a variable as the destination. Something like <a href=variablename><\a> where variablename specifies a page address within the website. But I can't work out how to parse the variable into the href statement.

Basically I'm trying to produce a sort of breadcrumb trail, such that at the top of each page a user has a sequential list of the pages he has visited up until now - these are passed url encoded (it's simple and it doesn't need to be secure). I then strip the passed variable to get the previous page name. I would just like to make the sequential list clickable, such that a user can go back to any page he has already visited.

This may be a complete waste of time, but hey, I want to do it!
Mar 14 '07 #1
7 20723
drhowarddrfine
7,435 Expert 4TB
If you mean something like paragraph 10 of a web page, try this:

If your web site is www.example.com/mypage.html, on the tenth paragraph you would do this:

<p id="thisparagraph">
Some text
</p>

Then, in the anchor of the referring page, you would do this:

<a href="www.example.com/mypage.html#thisparagraph">

Clicking on that link will then jump down to that paragraph of the page.
Mar 14 '07 #2
Not quite what I mean I'm afraid.

I've got the site set such that each preceeding page passes it's address to the next page via url encoding (i.e. www.site.com?page=page1.html).

The next page picks up the "page" variable. I would like to use that variable in an <a href statement, such that when I display the sequential list of previously visited pages (using the same variables passed by previous pages), they are displayed as links such that the user can use them to backtrack.

I know one can use the history in Javascript, but that doesn't give the explicit page addresses, (only -1 or -n etc ) which is not what I want.

Cheers
Mar 14 '07 #3
drhowarddrfine
7,435 Expert 4TB
Neither html nor css would be able to do that so you would need a server side language/program.
Mar 14 '07 #4
Thanks for that.

Bums - or other epithets. No wonder I couldn't find anything on the web. I take it that includes Javascript? It seems such a simple, straightforward thing.

Cheers
Mar 14 '07 #5
AricC
1,892 Expert 1GB
Thanks for that.

Bums - or other epithets. No wonder I couldn't find anything on the web. I take it that includes Javascript? It seems such a simple, straightforward thing.

Cheers
Yes Javascript is server side. You could do it in PHP or ASP. Here is a link to our PHP forum.

HTH,
Aric
Mar 14 '07 #6
natp
1
I think this is what you want:

Expand|Select|Wrap|Line Numbers
  1. <xsl:text disable-output-escaping="yes">&lt;a herf="</xsl:text>
  2. <xsl:value-of select="theUrl"></xsl:value-of>
  3. <xsl:text disable-output-escaping="yes">">Click Me&lt;/a></xsl:text>
  4.  
Sorry, for my poor typing. It should be href not herf.
May 28 '10 #7
drhowarddrfine
7,435 Expert 4TB
We can forgive you for typos but not for bringing up 3 year old threads.
May 28 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: G Kannan | last post by:
Hey all! I have written a perl script to retrieve information from a HTML Form and insert the data into an Oracle database table. I am gettting the the following error message: "Use of...
6
by: BigDadyWeaver | last post by:
I am using the following code in asp to define a unique and unpredictable record ID in Access. <% 'GENERATE UNIQUE ID Function genguid() Dim Guid guid =...
4
by: Japhy | last post by:
Hello, I'm am pulling data from a mysql db and want to use the data to populate a <ul. Here are relavent parts of my code : $wohdate = mysql_result($wohRS,$wohndx,woh_date); $woh_display...
8
by: Kathleen Dollard | last post by:
Hi, Oleg's answer about attribute value templates led me to look back at a different problem, and wonder if someone else had solved it. I want to output an ASP.NET page. Thus I need to output...
1
by: neilpeel | last post by:
Hello Can not seem to find any answers on google for markup problem. On website I would like to ask for data input and asign a variable to HERE. Then use that variable inside <a...
1
by: shalini jain | last post by:
Hi, I want to know how can we do pagination using XSL. There are number of tutorials available on pagination using PHP but nothing with XSL. i am really stuck with my code. Below is the code that...
4
by: mark4asp | last post by:
I'm getting a problem with this code and I think the offending linke is : <xsl:if test="$folder = 'Search'"> I want to test the value of the Folder element for a value of precisely "Search"...
5
by: coflo | last post by:
I am relatively new to XSL transforms so I apologize if my language or verbage is incorrect. I am trying to invoke a JS function of a flash player which requires a URI. In order to do this I would...
1
by: swethak | last post by:
hi, i have a code to disply the calendar and add events to that. It works fine.But my requirement is to i have to disply a weekly and daily calendar.Any body plz suggest that what modifications i...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.