Solved

Ajax Tabs

Posted on 2007-11-26
2
695 Views
Last Modified: 2010-08-05
I am working on getting these tabs working for my project.  I have the tabs but they are not working correctly.  I believe it is because they are being generated from a php array.  How can I define a variable to act as the current page in the script I am using?
<ul class="shadetabs">
<?php
	if (isset($_POST["list2"]) && is_array($_POST["list2"]) && count($_POST["list2"]) > 0)
	  {
	    foreach ($_POST["list2"] as $item)
	      {
	      	$link = str_replace(' ', '_', $item); ?>
	        <li><a href="#div_<?php print $link ?>"><?php print $item ?></a></li>
	<?php } } ?>
</ul>

Open in new window

0
Comment
Question by:taynet29
2 Comments
 
LVL 36

Expert Comment

by:Zyloch
ID: 20354415
Are your tabs controlled completely via Javascript without any page reloads? If so, you need to use Javascript to help style the active tab differently, and we will need to see more of your code.
0
 
LVL 10

Accepted Solution

by:
wildzero earned 500 total points
ID: 20354717
>>How can I define a variable to act as the current page in the script I am using?

$_SERVER["REQUEST_URI"]
or
$_SERVER["SCRIPT_NAME"]
or
$_SERVER["PHP_SELF"]

Arguments
$_SERVER["argv"]

a few there to take your pick from depending. Some contain arguments and some dont.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question