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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.