-5

I am checking whether a record exists in database or not

if ($row["count(*)"] == 0) {
    header('Location: first.php? stat = "not found"');
}

Now, to check the stat variable in first.php, I am doing -

print_r($_GET);

Output to this is -

Array ( [stat_] => "not found" ) 

I dont understand how 'stat' variable became 'stat_' variable ?

Dhruv Chadha
  • 961
  • 10
  • 28

1 Answers1

3

You need to remove the spaces in your header call:

header('Location: first.php?stat=not+found');
wogsland
  • 8,299
  • 18
  • 54
  • 83