tab selection

hi all im having trouble with my tab box. im trying to change which tab is active depending on which php file has run.
[php]

[/php]

the problem is when i click submit on the form the external php file does what is needed then redirects to the current page but the tab always goes to the first one “Add New Item” i know this is because of the" class=“tabview-active” " part but i want to move this to the other tabs depending which one is currently being used. (full code below)
[php]

<?php $current_page = "My-Area"; //dont display errors error_reporting(0); //Include database connection details require_once('config.php'); //Start session session_start(); if( isset($_SESSION['ERRMSG_ARR']) && is_array($_SESSION['ERRMSG_ARR']) && count($_SESSION['ERRMSG_ARR']) >0 ) { $responce .= ''; foreach($_SESSION['ERRMSG_ARR'] as $msg) { $responce .="$msg
"; } $responce .= ''; unset($_SESSION['ERRMSG_ARR']); } //Check whether the session variable SESS_MEMBER_ADMIN is present or not if($_SESSION['SESS_MEMBER_ADMIN'] == 'yes' ) { $string = ' Welcome '.$_SESSION['SESS_FIRST_NAME'].' '.$_SESSION['SESS_LAST_NAME'].'
Select file:
About: Spec: Image:
'. $responce.'
User name:
First name:
Last name:
'. $responce.'

Content for Tab 3

'; } elseif($_SESSION['SESS_MEMBER_ADMIN'] == 'no' ) { $string = 'customer'; } else{ $string = '

 

you need to log in
Log in
'; } ?> SNIPITS.CO.UK
<?php include "logo-navigation.php";?>
<?php
echo $string;?>

 

<?php include "foot.php"?>

[/php]

Hello cogga28, Here what I am understand from your post is that There is three tabs you are using for display content according to there tab selection Suppose you have three files like file1.php for tab1, file2.php for tab2, file3.php When file1.php is display that time tab1 is active, When file2.php is display that time tab2 is active, When file3.php is display that time tab3 is active You already know the all three files name. If I am getting correct from your post than do the below code [php] $tab1 = '';$tab2 = '';$tab3 = ''; $filename = array_reverse(explode('/',$_SERVER['SCRIPT_FILENAME'])); if($filename[0] == 'file1.php') $tab1 = 'class="tabview-active"'; elseif($filename[0] == 'file2.php') $tab2 = 'class="tabview-active"'; elseif($filename[0] == 'file3.php') $tab3 = 'class="tabview-active"'; else $tab1 = 'class="tabview-active"';

echo ’


';
[/php]
Note replace file1.php, file2.php and file3.php with your files name.
i hope this will helpful for you and suggest you in right direction.
Reply your feedback
SR
Sponsor our Newsletter | Privacy Policy | Terms of Service