-1

I am getting an error message was has never happened before, i am using same code but i hae updated my xampp Heres the code

<?php
session_start();
// Get the variable 

$op = $_REQUEST['op'];
$content = $_REQUEST['content'];
$id = $_REQUEST['id'];
$status = $_REQUEST['status'];


// Choose the operation
switch ($op){
    case "getList":
            $dbObj = new DBAccess();
            $dbObj->getList();
            break;
    case "addList":
            $dbObj = new DBAccess();
            $dbObj->addList($content);
            break;
    case "updateList":
            $dbObj = new DBAccess();
            $dbObj->updateList($id, $content);
            break;
    case "removeList":
            $dbObj = new DBAccess();
            $dbObj->removeList($id);
            break;
    case "removeAllList":
            $dbObj = new DBAccess();
            $dbObj->removeAllList();
    break;
}

I am getting the error for the op, content, id and status, but this has always worked before. Any ideas?

2 Answers2

1

May Be Your error_reporting was off before update .. You can ignore this error by following code but still you gotta find where is for it happend

$op = isset($_REQUEST['op'])?$_REQUEST['op']:'getList';
$content = isset($_REQUEST['content'])?$_REQUEST['content']:'';
$id = isset($_REQUEST['id'])?$_REQUEST['id']:'';
$status = isset($_REQUEST['status'])?$_REQUEST['status']:'';
Fisherman
  • 5,949
  • 1
  • 29
  • 35
0

It means that no form has submitted (post), or no parameters have been passed through the url(get). If you want to get variables from the session, you should use $_SESSION['op'] for example. $_REQUEST is considered bad practice since it contains all $_POST, $_GET and $_COOKIE data.

Jonan
  • 2,485
  • 3
  • 24
  • 42