Jump to content

Recommended Posts

Hey Everyone..

 

Here is what is going on...

 

on my website I have a login on the top rightish after someone logs in I want that login form to go away and have other information there.

 

I'm not really sure where to even start with this.

 

(everything else is done in terms of the actual login with php/mysql works and stuff.)

Link to comment
https://forums.phpfreaks.com/topic/180589-hard-question-hope-you-have-time/
Share on other sites

You need to change 'logged_in' to whatever the name your login script uses

 

It looks as if it's probably using cookies anyhow rather than sessionsbecause you're getting the error because you need session_start(); at the top of the document (but it would have this anyway if it was using sessions).

 

 

Here is the code I put where my login form is...  I have tried changing "login" to "$login" as that is what it is in my login-exec im just trying to get it to say "HTML FOR NOT LOGGED IN HERE". Im not going to mess around and put the actual login form there untill it says that without errors..

 

 

<?php

			session_start();
			if($_SESSION['login'] == true) {
                 ?>HTML HERE FOR LOGGED IN<?php
                 }else{
                 ?>HTML FOR NOT LOGGED IN HERE<?php
}
			?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.