0
votes

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. }
1
$_GET is an array. Try $_GET['view']. - user554546

1 Answers

4
votes

There's a typo bug:

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

should be

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