So then on my index.php
I Have:
$_GET['page'] = trim($page);
if (empty($page)) {
$_GET['page'] = "home";
}
//That a load of crap.. init..?
and on my include Ive got ..
<?php include ("flash/$_GET['page'] ") ; ?>
I'm lost in the woods.. and its all dark..
Download it and work it out..! If you can..!
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
No, you don't want to use $_POST - that's for forms that you posted using the POST method, you want to use $_GET which is for things that are in the query string, like your page variable, try:
at the top of your PHP script, and then
instead of
Then you should be able to do:
Mac
Code: Select all
foreach ($_GET as $key => $value) {
$_GETї$key] = trim($value);
}Code: Select all
if (!empty($_GETї'page'])) {
$page = $_GETї'page'];
} else {
$page = 'put whatever you want your default page to be here';
}Code: Select all
$page = trim($page);
if (empty($page)) {
$page = "news";
}Code: Select all
include $page.'.php';- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
You need to change it to:
notice how the strings like page/ and .php have to be in quotes and that the variable $page does not. The different parts are concenated (joined together) using fullstops (.'s).
Mac
Code: Select all
include 'page/'.$page.'.php';Mac
isn't that bad, is it?"hrm, let him figure it out himself then"
I think it's always more useful (for all) to only point to some directions and then let them figure it out for themselfs.
e.g. only providing links to manual/tutorials/other threads is no offense at all.
- There are (at least) three reasons for that
- obviously covered in manual/tutorials/other threads
- question of general nature, taking too much place here
- I don't really know, but this sounds reasonable

Too many cooks spoil the broth.