need help about page url in php
#1

Hi guys D

I have advanced toolbar system (Something like smf, with arrays etc...)

So I made if current address (Displayed in url bar) is equal to my path of that button (Example if I'm on blblab/index.php?action=admin on toolbar will activate class so it displays I'm on that page...) Anyway, now I have this url:
blablab/index.php?action=admin;editarticle but it doesn't says I'm on 'admin page' so how can I check that (I know I explained it like a shit but you will see it trough the code)
Reply
#2

You can check this code out and mod it for page name
PHP Code:
if ($_GET['pid'] >= && $_GET['pid'] <= 3)
{
    switch (
$_GET['pid'])
    {
        case 
0:
        {
            include(
"includes/index.php");
            break;
        }
        case 
1:
        {
            include(
"includes/something.php");
            break;
        }
        case 
2:
        {
            include(
"includes/something2.php");
            break;
        }
        case 
3:
        {
            include(
"includes/something3.php");
            break;
        }
    }
}
else
{
    die(
'That page does not exist');
}
    
?> 
The buttons links should be like,
PHP Code:
<a href="index.php?pid=0"><ul>Home</ul></a
Reply
#3

PHP also supports strings in switch statements, so you don't necessarily have to use numbers.
Reply
#4

(A)rray - you didn't understood me, I don't need including etc. just show that button is active if it contains 'that part' so if I have index.php?action=admin;editarticle button called 'admin' should be active, do you understand me now?
Reply
#5

Quote:
Originally Posted by System64
View Post
(A)rray - you didn't understood me, I don't need including etc. just show that button is active if it contains 'that part' so if I have index.php?action=admin;editarticle button called 'admin' should be active, do you understand me now?
So, you're trying to say is, if the user is at index.php?action=admin, he will be able to see the editarticle button.
For that you need to create includes and create variables.
The code above that i sent to you, will include the pages and show the link like, index.php?pid=1,
So if you are logged in, and access that include, you will be able to do whatever you want, but the diference is , the main page is calling external pages, wich will work together.
Reply
#6

no no, look at pictures:
http://www.zaslike.com/files/khmiwyjttdmxquozpusr.png index.php?action=admin
http://www.zaslike.com/files/27g98fpy8t83gsij7xfp.png index.php?action=admin;editarticle&id=2
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)