January 6th, 2014AWM: How to pass a PHP variable to a menu item link
Knowledge Base support case for AllWebMenus Pro, abstracted and stripped of all user’s private info.
Initial Email From: Jim
Initial Email Subject: Passing PHP variable to URL
Support Case Month: July 2013
I need to pass a variable, via PHP, to each URL in my menu as follows:
?BG=<?php echo $bg; ?>
so that the url would look like loading.php?BG=<?php echo $bg; ?> ... and it would resolve with the appropriate variable.
Couldn't find answer in knowledge base.
Reply From: Likno Customer Support
Hello Jim,
In order to achieve that, you should populate your menu through UL/LI structure.
Choose the following option in your AllWebMenus project:
Then click on the "Settings" in order to make the settings that perfectly work for you.
A UL/LI structure in your page could look like the one below:
<ul id="awmULLI-menu" style="display:none;">
<li><a href="test.php?BG=<?php echo $bg1; ?>">Main Item 1</a></li>
<li>Main Item 2
<ul>
<li><a href="test.php?BG=<?php echo $bg2; ?>">Sub Item 1</a></li>
<li>Sub Item 2
<ul>
<li>Sub Item 4</li>
<li>Sub Item 5</li>
<li><a href="test.php?BG=<?php echo $bg3; ?>">Sub Item 6</a></li>
</ul>
</li>
<li>Sub Item 3</li>
</ul>
</li>
<li>Main Item 3</li>
</ul>Let me know if you need any more information.
Thank you!
Regards,
Aggelos Tsakonas
Likno Customer Support
www.likno.com
Powerful javascript menus (CSS menus/drop-down menus/sliding menus), web trees, buttons, tabs, modals, tooltips, accordions, scrollers, designs for your websites!
Tags: LI, link, menu item, menu structure, PHP, UL, URL, variable