Can I assign a name to hyperlink so as I can use it in a session variable. The page the hyperlinks are on is a standard html page. I need to assign each one a name for use as a session variable. How do I do this?
u cannot get the name of an hyperlink in PHP. never tried it but i dont think it will work. since the links do not change (HTML page) why not save the links themselves in the session (hadrcode them)...
Using the name property of an <A> tag is for linking to different parts of the same page.
e.g. <a href=#myLocation>Location</A>
and down farther you would have:
<A NAME='myLocation'>DATADATADATA</A>
There is an ID property normally used for styling but ou should be able to adopt it to your own use. I haven't used it so im not sure of its limitations but give it a shot anyway
vbkris
I have a huge amount of hyperlinks (restaurants). If I could find some way of assigning a name to them then I wouldn't have to worry about making seperate view pages for them. I'm looking at possibly using hidden fields but I cant have a submit button. this is quite a mindbender!!!
so u say only the content changes huh? why dont u do this instead:
let all the links point to one php page:
<a href="link.php?lnk=Link1">Link1</a>
<a href="link.php?lnk=Link2">Link2</a>
in link.php:
<?
$lnk=$_GET['lnk'];
echo $lnk; //This will give u the link that has been clicked.
?>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.