vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Creating a custom login form, a problem, please help! (https://vborg.vbsupport.ru/showthread.php?t=40849)

Sion 07-09-2002 08:05 AM

Creating a custom login form, a problem, please help!
 
I have made an include called authusers.php which I will be calling on everypage to check if the user is auth'd or not on my whole site (non-vB pages too). This is so I can display unique content to my visitors...

Here is the code up to now:

PHP Code:

<?php //authusers.php

//include global.php
$curdir getcwd ();
chdir('/home/sion/public_html/forums/');
include_once (
'global.php');
chdir ($curdir);


// check if logged in
if ($bbuserinfo['userid']== 0) {
?>
<table border="0" cellpadding="0" cellspacing="0">
<form action="member.php" method="post">
<tr>
    <td nowrap><smallfont><b>Not cookied?</b><br>Login with username and password:</smallfont></td>
</tr><tr>
    <td nowrap><input type="hidden" name="s" value="$session[sessionhash]">
    <input type="hidden" name="action" value="login">
    <input type="text" class="bginput" name="username" size="7">
    <input type="password" class="bginput" name="password" size="7">
    <input type="submit" class="bginput" value="Login!"></td>
</tr>
</form>
</table>
<?php
} else {
  echo 
'you are logged in';
}
?>

I've just put the echo 'you are logged in'; to test if the script actually works, which it does.

This is what I'm trying to achieve: I include this php file in every page, and if the user is logged in, then it shows the rest of the page (eg. membersonly.php), otherwise (if the user is a guest) it only shows the login form above.

I hope you understand what I mean, ask me any Qs if anything needs clarifying.

Thanks in advance!

--Sion---

Admin 07-09-2002 11:41 AM

What help do you need?

Billspaintball 06-10-2006 02:38 AM

Doh!!

must look at dates before I post...


All times are GMT. The time now is 05:01 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01437 seconds
  • Memory Usage 1,714KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete