Solved

Ajax Tabs

Posted on 2007-11-26
2
670 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
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.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now