How can i get this to work properly:
if ((empty($page_name))
&& ($currentid == '$storedid')) { // PHP If Statement with multiple Checks
require_once("1.php");
} else { // PHP Else
require_once("2.php");
}
Right now regardless its showing me 2.php….
$page_name is a value for a db table. $currentid is session_id and $storedid is the stored id in the db for the $page_name.
Remove the single quotes in
($currentid == '$storedid')to
Your solution compares $currentid with a static string. Because of the single quotes $storeid is interpreted as a string.