Jump to content

[SOLVED] Help


tecmeister

Recommended Posts

When you add ?error= to index.php, what is it carried over to that page as?

 

$_GET['error'] would be the variable that is populated.

 

$error = isset($_GET['error'])?$_GET['error']:false;

if ($error !== false) {
    echo "Your error was {$error}.";
}

 

isset to check if that variable exists. The ? and : are ternary operators which act like a shortened if/else statement.

Link to comment
https://forums.phpfreaks.com/topic/155890-solved-help/#findComment-820559
Share on other sites

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.