vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Forum Login (https://vborg.vbsupport.ru/showthread.php?t=33169)

Lotus Ims 12-13-2001 05:01 PM

I need help with a PHP script. I would like users to be able to login to the forums from a non-vB page. If someone could make a script for me or show me how to do this, it would be much appreciated. I know HTML, so i can do the layout myself. I have tried one of the hacks posted here, but it didn't work. I have include what I would like it to look like below.

If user is not logged in:

------------------------------------------------------------------------------

Welcome Guest! Click Here to register or login below.

Username: |--------|
Password: |--------|

------------------------------------------------------------------------------

And if a user is logged in:

------------------------------------------------------------------------------

Wecome back Username. Click here to go to the forums or click here to logout.

You have # of Private Messages new messages. Click here to read them!

-----------------------------------------------------------------------------

Thanks

amykhar 12-13-2001 05:04 PM

Check the released hacks forum. Search for login. It's there already.

Amy

Lotus Ims 12-13-2001 05:05 PM

I already tried that, and it didn't work.

amykhar 12-13-2001 05:07 PM

What didn't work? The script or the search?

Amy

Lotus Ims 12-13-2001 09:05 PM

the script

Goldfinger 12-15-2001 12:45 AM

url to hack please.. i tried searching for it but couldnt find it =\

Hiroshimator 12-16-2001 07:43 AM

Code:

<?PHP
chdir("/path/to/board");
require("./global.php");
?>
<html>
<head>
<title>My homepage :D</title>
</head>
<body><table width=100%">
<tr>
<td><img src="board/images/vBulletin_logo.gif"></td>
<td valign=bottom align=right>

<?PHP
if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];
 
print("Welcome back, <b>$username!</b>");
}
else {
?>

you're not logged in
<p>
<form action="http://path/to/board/member.php" method="post" />
<input type="hidden" name="s" value="<?PHP print("$session[sessionhash]"); ?>" />
<input type="hidden" name="action" value="login" />
<table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr>
    <td align="left"><font class="verdana, arial, helvetica" size="1"><b>Username:</b></font></td>
    <td align="left"><input type="text" name="username" size="7" /></td>
  </tr>
  <tr>
    <td align="left"><font class="verdana, arial, helvetica" size="1"><b>Password:</b></font></td>
    <td align="left"><input type="password" name="password" size="7" /></td>
  </tr>
  <tr>
    <td align="center" colspan="2"><input type="submit" value="Login!" /></td>
  </tr>
</table>
</form>
</p>
<?PHP } ?>
</td></tr>
<tr><td colspan=2><?PHP print("<a href='./board/member.php?s=$session[sessionhash]&action=logout'>Log Out</a>"); ?></td></tr>
</table>
</body></html>


this should work, don't forget to fill in your own path to your board directory in the chdir() routine.

Lotus Ims 12-16-2001 11:13 PM

I tried the above script. HOwever, I want to use it with cookies, and on a non vB page. The login works fine, but when i got back to the page where I want the login, it doesn't have my username. It still acts like I am not logged in.

amykhar 12-16-2001 11:15 PM

Lotus Ims

If you have included the script with the url instead of the path to the file, that's probably why it doesn't work.

Amy

Hiroshimator 12-19-2001 01:00 PM

don't forget to set your cookie domain .mydomain.com (notice the first dot) in your board options


All times are GMT. The time now is 05:57 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.02221 seconds
  • Memory Usage 1,740KB
  • 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_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete