php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30396 Undefined variable: action
Submitted: 2004-10-11 15:57 UTC Modified: 2004-10-12 08:29 UTC
From: mojgan53 at hotmail dot com Assigned:
Status: Not a bug Package: *Compile Issues
PHP Version: 4.3.8 OS: Windows XP
Private report: No CVE-ID: None
 [2004-10-11 15:57 UTC] mojgan53 at hotmail dot com
Description:
------------
When I configure PHP4, I get this notice. This is not happening in upper versions.

Reproduce code:
---------------
if($action == "assigngroup")
   {
      if(!is_blank($group_id))
      {
         $sql = "DELETE FROM users2groups WHERE user_id = '" . $user_id . "';";
         mysql_query($sql);
         if($group_id != 0)
         {
            $sql = "INSERT INTO users2groups (user_id, group_id) VALUES ('" . $user_id . "', '" . $group_id . "');";
            mysql_query($sql);
         }
      }
      header("Location: users.php?action=view&user_id=" . $user_id);
      exit;
   }



Expected result:
----------------
Notice: Undefined variable: action in c:\program files\easyphp1-7\www\admin\users.php on line 220


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-11 19:50 UTC] helly@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.

The code snippet has not much to do with your bug report. Obviously we are not interested in the code that happens after the error and of course we are not interested in your complete code.

Also always try the latest version which is either 4.3.9 or 5.0.2 or CVS of course.
 [2004-10-12 08:29 UTC] derick@php.net
In PHP 4.2.0, the 'register_globals' setting default changed to
'off'. See http://www.php.net/release_4_2_0.php for more info.
We are sorry about the inconvenience, but this change was a necessary
part of our efforts to make PHP scripting more secure and portable.

.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 09:01:27 2024 UTC