Jump to content

check to see if several variables have been set


dazzclub

Recommended Posts

Hi there,

 

I'm working on a questionnaire and I need to ensure that the users cant proceed to the next page without selecting/completing a field.

 

I need to check multiple variables as the path the user takes depends on the submitted questions.

 

So I tried to use

if(!isset($response_time_email || $effectivenes ){

but I keep getting stumped.

 

Here is the original code;

if(isset($_POST['submitted'])) {


$response_time_email = $_POST['response_time_email'];


//has radio been checked

if(!isset($response_time_email)){

		$fail =  "<div id=\"fail\"><p>You must select a field before you proceed to the next page</p></div> ";

}else{

	if(isset($response_time_email)) {

	//$confirm = 'yes '.$contact_us.'';
	header('Location:page3.php');

	}
}
}

 

Any help would be great, thank you.

 

Darren

Your right made sense, thank you.

 

Here is the updated code;

if(isset($_POST['submitted'])) {


$recommend = $_POST['recommend'];



//has radio been checked

if($recommend == '') {

		$fail =  "<div id=\"fail\"><p>You must select a field before you proceed to the next page</p></div> ";

}else{


	//$confirm = 'yes '.$contact_us.'';
	header('Location:page7.php');

	}
}

 

Thank you

Darren

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.