tony
tony

Reputation: 71

Fatal error: Can't use function return value in write context

When I did the following php code, it gives me an error on line 2:

Fatal error: Can't use function return value in write context

Please help, thanks!

here is my code:

1. include_once 'functions.php';
2. if (isset($_GET('view'))) {
3.   if (!isset($_SESSION['uniid'])) {
4.     die("<h1>sorry, no access!</h1>");
5.     $login = false;
6.   }
7.   $login = true;
8. }

Upvotes: 0

Views: 2543

Answers (1)

Jon
Jon

Reputation: 437336

There's a typo bug:

if(isset($_GET('view'))){

should be

if(isset($_GET['view'])){  // square brackets!

Upvotes: 4

Related Questions