To read out the "action" you need the $_GET variable. You can use it with $_GET['action'].
You should ever use isset to ask if the variable is set or not. With this you can prevent errors.
if(isset($_GET['action']) && $_GET['action'] == 'register'){
do this
}else{
do this
}
Another example: when you ask if the action is set and after that you can ask if action == register or action == login or whatever
if(isset($_GET['action'])){
switch($_GET['action']) {
case 'register':
//do this
break;
case 'login':
//do this
break;
}
}