Jump to content

help with passing variables though URL


m4n1ac

Recommended Posts

$_GET and $_POST values are stored as strings so you cannot perform a strict comparison using a string and an integer, it will always equate to false. You can either use the loose comparison operator as Gristoi has done above, or you can cast the value stored in $_GET['error'] as an integer and use the strict comparison as you have done.

 

As a side note, always check that $_GET and $_POST values isset before assigning their value to a variable.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.