View Full Version : login box for non-vB pages
i need to do the following in non-vB pages:
(1) if the user already logged use their cookies and display a welcome $username + logout link
(2) if the user is not logged use the login form before displaying the page content.
(3) When the user logs in successfully, plant a cookie.
appreciate your help ...
thanks in advance
Marulatree
21 Mar 2003, 17:07
I need help with this too. I have gone through all the nonvb login box posts and none of them have helped - I really can't see why this is so hard. Please help some one.
start by including global.php, if your above the forum root do a chdir('./vb/') then include('global.php') then just do a if($bbuserinfo[userid] != 0) {DISPLAY WELCOME;} else {DISPLAY LOGIN BOX}
just copy the code from the templates to the page
Marulatree
22 Mar 2003, 23:04
Thanks i'll give that a go now.
Marulatree
23 Mar 2003, 00:23
Mr e,
I have put this into my index.php file on my www.mysite.com/index.php:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
and then further down I've added:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Everythings working fine except I get this at the top of my index file:
Warning: Cannot modify header information - headers already sent by (output started at /home/marulat/public_html/lib/mtlibrary.lib:19) in /home/marulat/public_html/forum/admin/functions.php on line 1652
There is a thread which explains the header errors in the hacking hints and tips forum. You might want to take a read of it :):
http://www.vbulletin.org/forum/showthread.php?s=&threadid=47126
Regards
- miSt
Marulatree
23 Mar 2003, 11:17
Thanks for the link miSt! I think the offending code is:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
This little piece of code is also used in the top of my page for another script:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Your Welcome :) - i hope your problem is now solved :D
- miSt
Marulatree
23 Mar 2003, 12:45
perfect all done. Thanks a million everybody for you help!
oh one more thing:
Where I have my login box include, it leave a HUGE gap above it. any ideas?
when i try this i keep getting the following
Fatal error: Call to undefined function: gettemplate() in /home/****/public_html/overallfoot.php on line 55
But why only on that template? the ones before it worked fine.
line 55 is:
eval("\$logincode = \"".gettemplate('webwelcome_logincode')."\";");
!!!cyr0n_k0r
03 May 2003, 07:40
Must the index have a PHP extension?
Is there another extension that can be used that will also work with php? IE *.asp or something?
vBulletin® v3.6.12, Copyright ©2000-2012, Jelsoft Enterprises Ltd.