gk20 Posted March 2, 2006 Share Posted March 2, 2006 For users that are logged in I want more links to appear, more information etc.... How do I do this?I accept from the users when logging in: login and pass and validate these. So far this worksFor users not logged in I only want to have links to pages like: home, register, login, about.But I want more for users who are logged in? I know I'm probably confusing, but does anybody understand what I'm trying to say?$login = $_POST['login'];$pass = $_POST['pass'];...... ...... if (!$fail) { $chklogin = @mysql_query("SELECT loginname,loginpass FROM login WHEREloginname = '$login' AND loginpass = '$pass'"); $chkuser = @mysql_query("SELECT loginname FROM login WHERE loginname = '$login'"); if (mysql_num_rows($chkuser) == 1) { if (mysql_num_rows($chklogin) == 1) { echo '<p><b>Welcome</b></p>'; echo '<p><b>Login successful</b></p>'; echo '<input type="submit" name="<href="#"" value="HOME">'; - this is probably where the code should go etc..... - or re-direct them to a page with all links etc and output their loginname on all pages from there onPlease help??? Quote Link to comment Share on other sites More sharing options...
khburres Posted March 2, 2006 Share Posted March 2, 2006 What you may want to do is store the links for user that have logged on in a separate html file that is 'included' when the login is validated. If the login is not validated, then the include would not take place.Something like:...include('header.html');include('links_allusers.html');if(goodLogin()){ include('links_login.html');}include('body.html');include('footer.html'); Quote Link to comment Share on other sites More sharing options...
gk20 Posted March 2, 2006 Author Share Posted March 2, 2006 OK, I get that. But my links file is displayed at the top of the page, where the login is validated further down in the body of the page. I want to display the links for logged in users at the top of the page with the existing ones???I can display the 2nd set of links but it will display them in the body??Is there any way that I could display all links on homepage but do a check to see if a user is logged in before displaying it, that way "banning" users that arent logged in from going there????? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.