Page 1 of 1

Load php-pages in same table-cell

Posted: Sun Nov 26, 2006 6:54 am
by torvald_helmer
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I have created many links i a table cell. They look like this:

[syntax="html"]<a href="?id=page2">page 2</a>
When i press the links I want the php-page to load in another
table cell, instead of just going to a new page.

I have used this php-code earlier on a different server,
and it works just fine. But on my new server there is php5,
don't know if that is the problem why it will not work.
Therefore I need you pro help:[/syntax]

Code: Select all

<?php
if (!$id)
{include("firstpage.php");} /*default page, will load first, and it does, but rest don't work */
elseif (!is_file("$id.php"))
{echo 'Page is under construction.';}
else
{include("$id.php");}
?>

When I press the links, the query line will look
like this; http://www.blablabla.com/?id=page2

Does anyone have a clue?


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Sun Nov 26, 2006 7:43 am
by feyd
Your first server likely had register globals on, a bad thing. PHP 5 is typically run with register globals off, a good thing.

You may want to look at isset() and $_GET.