Domain Empire

Notice: Undefined index: action in f:binapacheapachehtdocstopazhome.php on line

Spaceship
Watch
Impact
20
a little problem with my home server

Notice: Undefined index: action in f:binapacheapachehtdocstopazhome.php on line 98

im building a website and ive go this peice of code

PHP:
<?php switch ($_GET['action'])
{
    case 'privacy':
        include('privacy.html');
        break;
    case 'biog':
        include('biog.php');
        break;
    default:
        include('welcome.php');
}
 ?>

right,
if i go to home.php?action=biog i dont get the above error
but if i go to home.php i get the above error but it still includes welcome.php

and then when i upload all the files to my webspace that error disepears im using PHP Version 4.3.1 with apache 1.3 (not sure on the exact version)

is it something to do with the apache configureation or php itself? cheers
adam
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Hi,

What's in home.php on line 98?

Do you have register_globals turned on?

You can try something like:
PHP:
<?php
$action = $_GET['action'];
switch ($action) 
{
code
}

I'm not sure if it will help or not though. :D
 
0
•••
ah no wonder! cheers for your reply

cheers its off

ok next question how do i turn it on?


php.ini?

cheeers
 
0
•••
In your php.ini file, search for register_globals and change it from Off to On, that simple. :)

If your running php and apache on windows your php.ini file is probably located some where in your C:Windows directory or possibly C:WindowsSystem some where around there. :D

I don't know if that will fix the problem or not though, but you can try it.
 
0
•••
:crys:

its on

ive restarted apache by no joy yet

on line 98 there is

<?php switch ($_GET['action'])


oddd
 
0
•••
Hmmm I don't see anything wrong with the code really. It must be some configuration somewhere.

Is that the only place you have that code though, is in the home.php file?

<?php switch ($_GET['action'])
 
0
•••
One thing you can do is view your phpinfo on your web space and compare it to your phpinfo on your home installation.

Then try and make them identical and see if that works. If not that would atleast narrow it down some.
 
0
•••
0
•••
only thing thats majorly different are the apache modules

my host
Loaded Modules mod_log_bytes, mod_bwlimited, mod_php4, mod_frontpage, mod_ssl, mod_setenvif, mod_so, mod_auth, mod_access, mod_rewrite, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime, mod_log_config, mod_env, http_core

my pc
mentions nothing about modules :S
 
0
•••
Are the error_reporting settings in your phpinfo the same on both servers?

You can try changing it to this in your php.ini if it's not already, and the error may go away.

error_reporting = E_ALL & ~E_NOTICE

B-)
 
0
•••
you jenius!


cheers mate :D
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back