-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
  • 1,161
  • 2
  • 11
  • 33

1 Answers1

3

You need to remove the spaces in your header call:

header('Location: first.php?stat=not+found');
wogsland
  • 9,106
  • 19
  • 57
  • 93