Why is it that I got this message:
Quote:
Fatal error: Can't use function return value in write context in \create_wlc.php on line 49
PHP Code:if(!isset(mysql_escape_string($_GET["book"]))){
Printable View
Why is it that I got this message:
Quote:
Fatal error: Can't use function return value in write context in \create_wlc.php on line 49
PHP Code:if(!isset(mysql_escape_string($_GET["book"]))){
'mysql_escape_string' is a function and return values are apparently not accepted by 'isset'.Quote:
Originally Posted by PHP.net
You may want to use the 'emtpy' function instead of 'isset', or drop the 'mysql_escape_string'.
also you should take a look at this
I should use this?
if(!isset($_GET["book"])){
why you use mysql_real_escape_string()?
You might want to read the php manuals explanation.
Well, the way you are trying it now doesn't prevent anything.
Assuming you will eventually need the value of $_GET['book'], try this:
Sure you could use your original method with empty instead of isset, but you would eventually need to use mysql_real_escape_string() again when you want the value of 'book'.Code:$currentBook = mysql_real_escape_string($_GET['book']);
if(!empty($currentBook)){
// we got 'valid' input
}
Also if 'book' is an integer, you could use an (int) cast instead of mysql_real_escape_string().