Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3212636
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T14:51:31+00:00 2026-05-17T14:51:31+00:00

Fatal error: Can’t use function return value in write context in line 3, In

  • 0

Fatal error: Can’t use function return
value in write context in line 3,

In which cases such errors get triggered?

My program:

 //QUERY VARIABLE
 $query="select * form user where user_name='$user_name' and user_password='sha($user_password)'";

 //ESTABLISHING CONNECTION
 $result=mysqli_query($dbc,$query)or die('Error Querying Database');

 while($row=mysqli_num_rows($result)==1)
 {
  //SET COOKIE
  setcookie('user_name',$row['user_name']);
  setcookie('user_id',$row['id']);
  $query="select * form user";
  $result=mysqli_query($dbc,$query)or die('Error Querying Database');
  $page_url='http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/index.php';
  header('Location'.$page_url);
 }

 //TERMINATING CONNECTION
 mysqli_close($dbc);
 }
 else
 {
  $error_msg='Please type both user name and password correctly to login';
 }
//}
}
else
{
 $page_url='http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/register.php';
 header('Location'.$page_url);
}
}
if($output_form)
{
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
 <title>Mismatch - Log In</title>
 <link rel="stylesheet" href="stylesheets/style.css" media="all" />
</head>
<body class="body_style">
 <?php
 echo('<label class="signin_label">'.$error_msg.'</label>');
 ?>

<h2>Mismatch - Where Matches Happen...</h2>
<fieldset>
 <legend>Mismatch - Log In</legend>
 <form method="post" action="<?php $_SERVER['PHP_SELF']; ?>"><!--Self Referencing Form-->
 <label class="signin_label">USER NAME</label>
 <input type="text" name="user_name" title="Enter Your Account User Name" class="signin_textbox" value="<?php if(!empty($_POST['user_name']))$_POST['user_name']; ?>" /><br />
 <label class="signin_label">PASSWORD</label>
 <input type="password" name="user_pwd" title="Enter Your Account Password" class="signin_textbox" value="" /><br />
</fieldset>
 <input type="submit" name="login_submit" title="Click To Log In" value="Log In" class="button" />
<?php
}
?>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T14:51:31+00:00Added an answer on May 17, 2026 at 2:51 pm

    Try changing

    if(!isset($_COOKIE(user_id)))
    

    to

    if(!isset($_COOKIE['user_id']))
                      ^^       ^^
    

    $_COOKIE is an associative array.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.