Jump to content

function to pass link "text" as variable


gammaman

Recommended Posts

Hello again.  I am trying to pass the link text name through $_GET to display.php using a funciton which finds the link text.

 

<body>
	<ul class="sf-menu">
		<li class="current">
			<a href="display.php?category=">Entertainment</a>
			<ul>
				<li>
					<a href="#aa">menu item that is quite long</a>
				</li>
				<li class="current">
					<a href="#ab">menu item</a>
					<ul>
						<li class="current"><a href="#">menu item</a></li>
						<li><a href="#aba">menu item</a></li>
						<li><a href="#abb">menu item</a></li>
						<li><a href="#abc">menu item</a></li>
						<li><a href="#abd">menu item</a></li>
					</ul>
				</li>

 

Let's just take this small piece for example

 

<li class="current">
			<a href="display.php?category=">Entertainment</a>
			<ul>
				<li>

 

I want category here to = Entertainment.  I don't just want to type it b/c what if I have thousands of category's. 

 

Is there some way to do this?

 

 

Link to comment
https://forums.phpfreaks.com/topic/265701-function-to-pass-link-text-as-variable/
Share on other sites

Yes.  I am doing exactly that.  The next problem is that each category can have an undetermined about of sub categories.  Those subcategories could also contain an undetermined amount of subcategories and so on.  Any suggestion on the best way to handle this?  Should I create tables for all the subcategory levels?  I think this is a bit much.  I was thinking of somehow assigning an index to each "category" which will determine how deeply nested it is.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.