View previous topic :: View next topic |
Author |
Message |
ben-l -
Joined: 22 Apr 2003 Posts: 2
|
Posted: Tue Apr 22, 2003 9:36 pm Post subject: ?action=... |
|
|
Hi
When i try to open my homepage wih index.php?action=news it doesn't work properly. It acts as if action was set to nothing! When i opened the page on tripod, everything worked properly and it showed the news.
I installed php 4.3.1; I set register_globals = Off to register_globals = On and did everything the php tutorial says, but it still opens the main page and not the news, as it should
where's the mistake?
here's the script:
Code: |
<?php
if(!isset($action))
{
include("home.html");
}
else
{
if(file_exists("$action.html"))
{
include("$_action.html");
}
}
?> |
|
|
Back to top |
|
|
Omar G -
Joined: 21 Mar 2003 Posts: 34 Location: Honolulu, Hawai'i
|
Posted: Tue Apr 22, 2003 11:41 pm Post subject: |
|
|
Hi!
Despite having register_globals = On, it may be better anyway to write $_REQUEST['action'] or even $GLOBALS['action'].
$_GET['action'] wil be foolproof, but will not catch form posts; use $_POST['action'] for that. $_REQUEST will catch them both, fom either a URL or form post.
- Omar G |
|
Back to top |
|
|
ben-l -
Joined: 22 Apr 2003 Posts: 2
|
Posted: Wed Apr 23, 2003 8:23 am Post subject: |
|
|
ah thanks!
everything works now :D |
|
Back to top |
|
|
|