Page 1 of 1

Linke sider: ="?p...

Posted: Tue Feb 26, 2008 1:03 pm
by Scoopex
Hello.
I try to get my simplet PHP page function. I use PHP for a navigation menu.

In menu.inc it looks like this:
<a href="?p=replayes.inc">Replayes</a>
<a href="?p=index.inc">Home</a>
etc.

But what do i write where the text is about to get shown? In index.php.

Re: Linke sider: ="?p...

Posted: Tue Feb 26, 2008 1:53 pm
by yacahuma
could you rephrase your question?

Re: Linke sider: ="?p...

Posted: Tue Feb 26, 2008 2:35 pm
by Scoopex
Ok..

I got this menu.inc file. It sayes:
<a href="?p=index.inc">Home</a><br>
<a href="?p=info.php">Info</a><br>
++

But how do i get mye index.php to show this "index.inc" and "info.inc" when click the link?

Re: Linke sider: ="?p...

Posted: Tue Feb 26, 2008 2:50 pm
by Christopher
That should be index.php, not index.inc.

Re: Linke sider: ="?p...

Posted: Tue Feb 26, 2008 3:31 pm
by Scoopex
Yes, but i want the text in ex. index.inc to get shown in the index.php.

With this i just have to have one page (index.php). and a lot of *.inc dokuments with text.
This texts will be shown in index.php when pressing the link to the *.inc file.

U see what i mean?

Re: Linke sider: ="?p...

Posted: Wed Feb 27, 2008 7:26 am
by yacahuma
is kind of hard to understand why you want to bring the text to index.php

with an <a href="url">xxx</a> your pages moves to the url.


Another thing is that your could have a div on index.php and you want to load external data into that div when clicking on the link. Is this what you want???

Re: Linke sider: ="?p...

Posted: Wed Feb 27, 2008 7:34 am
by shiznatix
if you want the data that is located in the file index.inc to load into some spot on your current page then do something like this:

Code: Select all

if (!empty($_GET['p']))
{
    switch $_GET['p']
    {
        case 'index.inc':
            require_once 'index.inc';
            break;
        case 'info.inc':
            require_once 'info.inc';
            break;
    }
}
[syntax=php][/syntax]

Re: Linke sider: ="?p...

Posted: Wed Feb 27, 2008 12:22 pm
by Scoopex
Another thing is that your could have a div on index.php and you want to load external data into that div when clicking on the link. Is this what you want???

This is what i ment.. i use a div and want external data into that.. someone?