Linke sider: ="?p...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Scoopex
Forum Newbie
Posts: 4
Joined: Tue Feb 26, 2008 1:00 pm

Linke sider: ="?p...

Post 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.
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

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

Post by yacahuma »

could you rephrase your question?
Scoopex
Forum Newbie
Posts: 4
Joined: Tue Feb 26, 2008 1:00 pm

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

Post 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?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

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

Post by Christopher »

That should be index.php, not index.inc.
(#10850)
Scoopex
Forum Newbie
Posts: 4
Joined: Tue Feb 26, 2008 1:00 pm

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

Post 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?
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

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

Post 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???
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

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

Post 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]
Scoopex
Forum Newbie
Posts: 4
Joined: Tue Feb 26, 2008 1:00 pm

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

Post 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?
Post Reply