473,804 Members | 2,070 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using a Variable in an <a href statement

3 New Member
I would like to be able to open a link utilising a variable as the destination. Something like <a href=variablena me><\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 20770
drhowarddrfine
7,435 Recognized Expert Expert
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="thisparagra ph">
Some text
</p>

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

<a href="www.examp le.com/mypage.html#thi sparagraph">

Clicking on that link will then jump down to that paragraph of the page.
Mar 14 '07 #2
malineau
3 New Member
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?pa ge=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 Recognized Expert Expert
Neither html nor css would be able to do that so you would need a server side language/program.
Mar 14 '07 #4
malineau
3 New Member
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 Recognized Expert Top Contributor
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 New Member
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 Recognized Expert Expert
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
14158
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 uninitialized value in concatenation (.) at register.pl line 38, <STDIN> line 10." The PERL code is as follows:
6
2754
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 = server.createobject("scriptlet.typelib").guid guid=Left(guid,instr(guid,"}")) genguid=guid
4
2718
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 .="<li>".$wohdate."</li>" ; $TemplateText = Replace($TemplateText,"@$wohdisplayndx@",$woh_display);
8
6025
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 ASP.NET tags and HTML tags. <%@ Page Language= etc...
1
2691
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 href="http://www.fincaslostajos.com/ingles/informacion2_in.php?ref=HERE&fotog=1&nfotos=5" title="Mas Info" target="_blank"><strong>Ref:395JAFCP &lt;&lt;&lt; Más Info - More information </strong></a><br> where HERE is variable Thanks Neil Payne
1
6853
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 i have written for pagination but it displays the link of all the pages at one go i.e. if i have 8 pages showing 10 results per page than it shows links for all 8 pages. Previous 1-10 11-20 21-30 31-40 41-50 51-60 61-70 71-80 Next i want to...
4
2438
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" and include the extra html as shown below if the test passes. The rest of the code validates and so, I hope, works. What am I doing so very wrong here?
5
2958
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 like to take the RSS feed, the snippet below, and grab the uri from the <enclosure> tag. You will see that there is a &uri=channels/39174/186941 inside of the url="" i would like to grab this piece and insert it into my XSL <a href= as currently...
1
3467
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 have to made in my code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type"...
0
9711
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9593
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10088
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7633
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4306
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.