Load php-pages in same table-cell

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
torvald_helmer
Forum Newbie
Posts: 4
Joined: Sun Nov 26, 2006 6:51 am

Load php-pages in same table-cell

Post 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]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

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