Jump to content

If statement help


slj90

Recommended Posts

It is recommended to place IF statements within blocks to be more portable and syntactically correct. And as mentioned, you are using the assignment operator "=" instead of the comparrison operator "=="

<?php
session_start(); //Required if not already in your code.
if ($_SESSION['authenticatedUser'] == 'admin') {
  echo "Admin Panel";
}
?> 

Link to comment
https://forums.phpfreaks.com/topic/188864-if-statement-help/#findComment-997131
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.