Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal error: Cannot use isset, use null expression

Tags:

html

php

I keep receiving the error:

Fatal error: Cannot use isset() on the result of an expression (you can use "null !== expression" instead) in line 42

This is line 42:

if (isset($_GET['reply_id'] && $_GET['reply_user'])) {

Here's the "entire" part of that code:

<?php
if (isset($_GET['reply_id'] && $_GET['reply_user'])) {
$reply_id = $_GET['reply_id'];
$reply_user = $_GET['reply_user'];
echo '<form action="#" method="post">
<center>
<textarea rows="4" cols="50" maxlength="300" name="comment_box" placeholder="Say something awesome..." Style="width:94%;font-family:helvetica;font-size:14px;">@' . $reply_user . '.</textarea></center>
<center><input type="submit" name="post2" class="post_text" value="Post"></center>
</form>';
}
?>

How do I fix this?

like image 503
PHP Web Dev 101 Avatar asked Oct 25 '25 07:10

PHP Web Dev 101


1 Answers

Do you mean

 if ( isset($_GET['reply_id'], $_GET['reply_user']) ) {
      // code here
 }
like image 162
invisal Avatar answered Oct 27 '25 22:10

invisal