Fix if statement to use Double equals (==) instead of Single equal (=) which would overwrite the value of $_GET['name'] variable.
		
			
				
	
	
	
		
			1.2 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	
			1.2 KiB
		
	
	
	
	
	
	
	
title
| title | 
|---|
| Conditionals | 
Conditionals
Conditionals in PHP are written using the if, elseif, else syntax. Using conditionals allows you to perform different actions depending on different inputs and values provided to a page at run time. In PHP conditionals are often referred to as control structures.
If
<?php
if ($_GET['name'] == "freecodecamp"){
  echo "You viewed the freeCodeCamp Page!";
}
Elseif
<?php
if ($_GET['name'] == "freecodecamp"){
  echo "You viewed the freeCodeCamp Page!";
} elseif ($_GET['name'] == "freecodecampguide"){
  echo "You viewed the freeCodeCamp Guide Page!";
}
Else
<?php
if ($_GET['name'] == "freecodecamp"){
  echo "You viewed the freeCodeCamp Page!";
} elseif ($_GET['name'] == "freecodecampguide"){
  echo "You viewed the freeCodeCamp Guide Page!";
} else {
  echo "You viewed a page that does not exist yet!";
}
Note
In cases where you have a lot of possible conditions you may want to use a Switch Statement.