Jump to content

[SOLVED] Fatal error: Can't use method return value in write context


Recommended Posts

hi

I am having trouble with an if statement that I created in oo and I am wondering does anyone know if what I am doing is correct?

 

this is the statement

if ($correction_object->correction_checked() = 1){

 

this is  the error i get

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

 

 

 

public function correction_function () {
			// the if statement is for startup will skip correction if gobals
			// have not had the chance to obtain properties
			if ($_SESSION['$answer'] = ''){
			      random_function();
			} else { 
				   correction_true_false ($_POST['form_value']);          

					if ($correction_object->correction_checked() = 1){
					// send it to the correction function
					random_function ();	
					} else {
					//needs to return to last figures
					$_SESSION['$number1'];
					$_SESSION['$number2'];
					}
			}
            
}

public function correction_true_false ($correction_post){

			   if ($_SESSION['random-answer'] == $correction_post){
			    $this->correction_outcome =  1;
			   } else {
			    $this->correction_outcome =  0;
			   }


}

 

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.