mardi 25 juillet 2017

PHP Coding Logic

I have some code that always is returning $aid=1 within an else/if statement. Can anyone help me figure out why this may be happening within the logic?

if(isset($_SESSION['account_id'])) {
$aid = $_SESSION['account_id'];
} else if(isset($_POST['aid'])) {
$aid = $_POST['aid'];
} else if(isset($_GET['aid'])) {
$aid = $_GET['aid'];
} else {$aid='1';}

Quick background (if it helps)... This is for a login. Once a client signs in I am trying to get only their data within the database to show. I have all of the correct data being pulled, but I cannot get the logged in user to call in the correct account_id. If I were to change the last $aid=1 to $aid=2, then it would correctly pull all of account_id=2 information, but it would do it for every logged in person.

Any advice is greatly appreciated.

Thanks!

Aucun commentaire:

Enregistrer un commentaire