?
Solved

Ajax Tabs

Posted on 2007-11-26
2
Medium Priority
?
715 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 2000 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to dynamically set the form action using jQuery.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Suggested Courses

777 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