What's all this index.php?e=somepage business?

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
User avatar
Grunge
Forum Newbie
Posts: 4
Joined: Wed Jun 05, 2002 7:36 pm
Location: California
Contact:

What's all this index.php?e=somepage business?

Post by Grunge »

I was just wondering, what's all the PHP hoohaw and what's it do?

... and where can I learn to do something like that? :)

Thanks.
User avatar
Sevengraff
Forum Contributor
Posts: 232
Joined: Thu Apr 25, 2002 9:34 pm
Location: California USA
Contact:

Post by Sevengraff »

They set up a big template on thier site, usually just a plain layout, then they have something like <?PHP include("$page.html"); ?> where they want to include content. its very useful for sites that change thier layouts a lot.

The best newbie tutorial that I have seen is Here.
User avatar
NetDragonX
Forum Newbie
Posts: 15
Joined: Sat May 25, 2002 3:00 pm
Location: Southern California

Post by NetDragonX »

Grunge:

When you see an URL which looks like index.php?e=somepage, basically what is happening is this:

Code: Select all

<?php

if ($e == '123')
   $include = 'stuff.php';
elseif ($e == 'links')
   $include = 'links.php';

require('header.php');
require($include);
require('footer.php');

?>
So when you see a 'page.php?var=stuff', that means the URL actually includes a variable that you can access via PHP. I was looking at that tutorial the guy suggested and I didn't find anything about this, so I hope this helps.

- Dragon
User avatar
Grunge
Forum Newbie
Posts: 4
Joined: Wed Jun 05, 2002 7:36 pm
Location: California
Contact:

Post by Grunge »

Hmmm. I nderstand. Thanks you two :)

Do any of you happen to know if that works with actual templates and variable instead of includes? :\ Just a-wondering :)

Thanks again.
User avatar
NetDragonX
Forum Newbie
Posts: 15
Joined: Sat May 25, 2002 3:00 pm
Location: Southern California

Post by NetDragonX »

Yeah, you can still do whatever you want to do with variables inside of other includes. On my site, my single front page must consist of 20 or so various includes on various levels. The server won't send the webpage to the browser until all parsing is done... and that's includes all includes().

- see ya
User avatar
Kriek
Forum Contributor
Posts: 238
Joined: Wed May 29, 2002 3:46 am
Location: Florida
Contact:

Post by Kriek »

NetDragon: Very nice site.
What's with all the banners and stuff though?
Post Reply