brainmltdwn Posted February 24, 2011 Share Posted February 24, 2011 I am setting up a login for my website and I am very new to PHP coding. The script lets me login, and brings me to the logged in page. I want it to bring up the logged in page and then open a new page at another URL. How can I do this. Here is the code I need to change, but im not sure what to put in to have it open another page in a new window. also the second set of code is for the logout button. How do I get it to do the same thing as clicking logout by just closing the browser. functions.inc.php: <?php function show_userbox() { // retrieve the session information $u = $_SESSION['username']; $uid = $_SESSION['loginid']; // display the user box echo "<div id='userbox'> Welcome $u <ul> <li><a href='/RRP/index.html'> Please Click Here To enter E-Learning</a></li> <li><a href='./logout.php'>You Must Click Logout Here</a></li> </ul> </div>"; } ?> Logout.php: <?php session_start(); if( session_unregister('loginid') == true && session_unregister('username')==true ) { header('Location: index.php'); session_destroy(); } else { unset($_SESSION['loginid']); unset($_SESSION['username']); session_destroy(); header('Location: index.php'); } Please. any help would be great. Thank You. Link to comment https://forums.phpfreaks.com/topic/228727-php-codeing-problems/ Share on other sites More sharing options...
Maq Posted February 24, 2011 Share Posted February 24, 2011 - For PHP Coding questions, please post in the PHP Coding Help section for now on - Also, use tags for code, not tags. Link to comment https://forums.phpfreaks.com/topic/228727-php-codeing-problems/#findComment-1179243 Share on other sites More sharing options...
brainmltdwn Posted February 24, 2011 Author Share Posted February 24, 2011 Sorry, I am new.. if you are able can you move the post to that section. Thank you Link to comment https://forums.phpfreaks.com/topic/228727-php-codeing-problems/#findComment-1179251 Share on other sites More sharing options...
Maq Posted February 24, 2011 Share Posted February 24, 2011 Sorry, I am new.. if you are able can you move the post to that section. Np. Already did. Link to comment https://forums.phpfreaks.com/topic/228727-php-codeing-problems/#findComment-1179252 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.