Hi, does anyone have any idea why this is not working correctly
<?php if (!isset($_COOKIE['clients_id']) || empty($_COOKIE['clients_id'])) { ?>
Even if the cookie is set it still shows the content of that IF statement and not the ELSE.
What happens with a simple
if($_COOKIE['clients_id']) {//??? hmmm??}
or echo $_COOKIE['clients_id'];
The full code is below. I can echo the values of the cookie but can not use them in the IF and ELSE statement.
<?php if (!isset($_COOKIE['clients_id']) || empty($_COOKIE['clients_id'])) { ?> <form method="post" action="<?php echo("$url"); ?>/clients_log_action.php?log_action=login"><table width="499" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="90" class="maintext">Username:</td> <td width="10"> </td> <td width="399"><input name="username" type="text" size="30" class="maintext"></td> </tr> </table> <table width="499" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="90" class="maintext">Password:</td> <td width="10"> </td> <td width="399"><input name="password" type="password" size="30" class="maintext"></td> </tr> </table> <table width="499" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="90"> </td> <td width="10"> </td> <td width="84"><div align="right"> <input type="submit" name="Submit" value="Submit" class="maintext"> </div></td> <td width="10"> </td> <td width="85"><input type="reset" name="Reset" value="Reset" class="maintext"></td> <td width="220"> </td> </tr> </table> </form> <?php } else {echo("Test");} ?>
I done it now, all i had to delete was a bit off the IF statement.
if (!isset($_COOKIE['clients_id']) || empty($_COOKIE['clients_id']))
if (empty($_COOKIE['clients_id']))