Solved

Ajax Tabs

Posted on 2007-11-26
2
703 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

749 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