Jump to content

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


gish

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;
			   }


}

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.