I have met a very strange bug. Given the same piece of code:
<?php session_start(); ?>
<?php if (!isset($_SESSION['email'])): ?>
<p><a href="admin_reg.php">Regsiter as admin</p>
<p><a href="student_reg.php">Register as student</p>
<p><a href="login.php">Log in</a></p>
<? else: ?>
<p><a href="logout.php">Log out</a></p>
<p><a href="group_create.php">Create group</a></p>
<p><a href="group_join.php">Join group</a></p>
<?php endif; ?>
My group mates and I run the same project on different machines (they use windows and I use mac). We all run it in the xampp and I get a normal result: Before authentication, just the first three links appear. But in their machines, all six links have shown on the page, which is impossible. Our PHP version are also the same: 5.6.1*
. Do you have any idea about it? Thanks in advance!
Your else is using short tags, which may not be enabled on all servers. Change it to use the full php tag:
<?php else: ?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With