vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   VB Login on a Non-VB Page vB3 RC3 (https://vborg.vbsupport.ru/showthread.php?t=61112)

T3MEDIA 12-25-2004 02:51 AM

Quote:

Originally Posted by vbmechanic
One suggestion, if you chdir at the top of the program to include something, you should also chdir back to the original location so you don't disrupt any relative includes further down the code.

PHP Code:

chdir("forum/"); 
require(
'./global.php');  
chdir("../); 

cheers!

Woah was on your site vbmechanic... there are a LOT of unhappy customers. Glad I didnt buy anything form you!

GuppyWithAGun 01-25-2005 03:32 AM

I am getting these errors at the bottom of my page... any ideas why? I am able to get it to log in and show detail find. The only problem i am running into is this.
Code:

Warning: mysql_query(): 7 is not a valid MySQL-Link resource in /home/guppy/public_html/forums/includes/db_mysql.php on line 212

Warning: mysql_error(): 7 is not a valid MySQL-Link resource in /home/guppy/public_html/forums/includes/db_mysql.php on line 357

Warning: mysql_errno(): 7 is not a valid MySQL-Link resource in /home/guppy/public_html/forums/includes/db_mysql.php on line 358

Warning: mysql_query(): 7 is not a valid MySQL-Link resource in /home/guppy/public_html/forums/includes/db_mysql.php on line 212

Warning: mysql_error(): 7 is not a valid MySQL-Link resource in /home/guppy/public_html/forums/includes/db_mysql.php on line 357

Warning: mysql_errno(): 7 is not a valid MySQL-Link resource in /home/guppy/public_html/forums/includes/db_mysql.php on line 358


PTO 01-26-2005 04:39 PM

someone help please =)
Im getting this error:

Code:

Unable to add cookies, header already sent.
File: /home/invictus/public_html/rbar1_info.php
Line: 4

here is my current code:

top page
Code:

<?
chdir("forum/");
include('forum/global.php'); 

// added this line to include the user functions which
// has the fetch_avatar_url() function
include('./includes/functions_user.php');

chdir("../");
?>

where i want login
Code:

<?
if ($bbuserinfo['userid']!=0) {
    $username=$bbuserinfo['username'];
   

    // i assigned the avatar url to the variable $user_av and check to see if it's empty.
    $user_av = fetch_avatar_url($bbuserinfo['userid']);
    if($user_av!='')
      $user_av="/forum/" . $user_av;  //replace "/forum/" with your virtual path to your forum pages.

    print("<align='center'><span class='sectionheader'>Welcome back, $username!<br>");
   
    //if the avatar url is not empty, display it
    if($user_av!='')
        print("<img src=\"" . $user_av . "\" vspace=4>");
} else {
?>
<form action='/forum/login.php' method='post' onsubmit='md5hash(vb_login_password,vb_login_md5password)'>
        <script type='text/javascript' src='/forum/clientscript/vbulletin_md5.js'></script>
       
        <span class="sectionheader">Username:</span>
            <input type='text' class='button' name='vb_login_username' id='navbar_username' size='15' accesskey='u' tabindex='1' value='' onfocus='if (this.value == 'username') this.value = '';' /><br>
           
            <span class="sectionheader">Password:&nbsp;</span>
            <input type='password' class='button' name='vb_login_password' size='15' accesskey='p' tabindex='2' /><br>
            <input type='checkbox' name='cookieuser' value='1' tabindex='3' id='cb_cookieuser_navbar' accesskey='c' checked='checked' /><span class='sectionheader'>Remember Me</span><br>
       
       
       
        <input name="submit" type='submit' class='button' accesskey='s' tabindex='4' title='Log In' value='Log In' />
        <input type='hidden' name='do' value='login' />
        <input type='hidden' name='forceredirect' value='1' />           
        <input type='hidden' name='vb_login_md5password' />
        </form>
                        <?

}

?>


dtsp 02-07-2005 03:48 AM

ok everything goes alright except..when i add

<?php
chdir("forum/");
require('./global.php');
chdir("../);
?>

to my index.php page of my non vb page it displays the forum login (not the

<?

if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];

print("<align='center'><span class='sectionheader'>Welcome back, $username!<br>");

} else {


?>
<form action='/forum/login.php' method='post' onsubmit='md5hash(vb_login_password,vb_login_md5pa ssword)'>
<script type='text/javascript' src='/forum/clientscript/vbulletin_md5.js'></script>

<span class="sectionheader">Username:</span>
<input type='text' class='button' name='vb_login_username' id='navbar_username' size='15' accesskey='u' tabindex='1' value='' onfocus='if (this.value == 'username') this.value = '';' /><br>

<span class="sectionheader">Password:&nbsp;</span>
<input type='password' class='button' name='vb_login_password' size='15' accesskey='p' tabindex='2' /><br>
<input type='checkbox' name='cookieuser' value='1' tabindex='3' id='cb_cookieuser_navbar' accesskey='c' checked='checked' /><span class='sectionheader'>Remember Me</span><br>



<input name="submit" type='submit' class='button' accesskey='s' tabindex='4' title='Log In' value='Log In' />
<input type='hidden' name='do' value='login' />
<input type='hidden' name='forceredirect' value='1' />
<input type='hidden' name='vb_login_md5password' />
</form>
<?

}

?>

) but the actual login page for the index.php of the forum (unregistered login page)
and it doesn't show any the original html of non-vb index page.

can someone help me with that? plz

morphistation 02-24-2005 03:09 PM

For those that where looking for the script to redirect you to the forums after login:

PHP Code:

<?php 
  chdir
("forum/"); 
require(
'./global.php');   
chdir("../"); 
if (
$bbuserinfo['userid']!=0) { 
$username=$bbuserinfo['username']; 
   
header("Location: http://www.exmaple.com/forum/index.php");

} else { 
?> 
<html>
<head>
</head>

<body>
<form action='/forum/login.php' method='post' onsubmit='md5hash(vb_login_password,vb_login_md5password)'> 
        <script type='text/javascript' src='/forum/clientscript/vbulletin_md5.js'></script> 
         
         <span class="sectionheader">Username:</span> 
            <input type='text' class='button' name='vb_login_username' id='navbar_username' size='15' accesskey='u' tabindex='1' value='' onfocus='if (this.value == 'username') this.value = '';' /><br> 
             
            <span class="sectionheader">Password:&nbsp;</span> 
            <input type='password' class='button' name='vb_login_password' size='15' accesskey='p' tabindex='2' /><br> 
            <input type='checkbox' name='cookieuser' value='1' tabindex='3' id='cb_cookieuser_navbar' accesskey='c' checked='checked' /><span class='sectionheader'>Remember Me</span><br> 
         
         
         
        <input name="submit" type='submit' class='button' accesskey='s' tabindex='4' title='Log In' value='Log In' /> 
        <input type='hidden' name='do' value='login' /> 
        <input type='hidden' name='forceredirect' value='1' />             
        <input type='hidden' name='vb_login_md5password' /> 
        </form> 
                        <? 



?> 
</body>
</html>


asimply1 02-24-2005 10:20 PM

Quote:

Originally Posted by morphistation
For those that where looking for the script to redirect you to the forums after login:

PHP Code:

<?php 
  chdir
("forum/"); 
require(
'./global.php');   
chdir("../"); 
if (
$bbuserinfo['userid']!=0) { 
$username=$bbuserinfo['username']; 
   
header("Location: http://www.exmaple.com/forum/index.php");

} else { 
?> 
<html>
<head>
</head>

<body>
<form action='/forum/login.php' method='post' onsubmit='md5hash(vb_login_password,vb_login_md5password)'> 
        <script type='text/javascript' src='/forum/clientscript/vbulletin_md5.js'></script> 
         
         <span class="sectionheader">Username:</span> 
            <input type='text' class='button' name='vb_login_username' id='navbar_username' size='15' accesskey='u' tabindex='1' value='' onfocus='if (this.value == 'username') this.value = '';' /><br> 
             
            <span class="sectionheader">Password:&nbsp;</span> 
            <input type='password' class='button' name='vb_login_password' size='15' accesskey='p' tabindex='2' /><br> 
            <input type='checkbox' name='cookieuser' value='1' tabindex='3' id='cb_cookieuser_navbar' accesskey='c' checked='checked' /><span class='sectionheader'>Remember Me</span><br> 
         
         
         
        <input name="submit" type='submit' class='button' accesskey='s' tabindex='4' title='Log In' value='Log In' /> 
        <input type='hidden' name='do' value='login' /> 
        <input type='hidden' name='forceredirect' value='1' />             
        <input type='hidden' name='vb_login_md5password' /> 
        <input type="hidden" name="url" value="http://localhost/vb2"/>
        </form> 
                        <? 



?> 
</body>
</html>


only add
<input type='hidden' name='do' value='login' />
<input type='hidden' name='forceredirect' value='1' />
<input type='hidden' name='vb_login_md5password' />
<input type="hidden" name="url" value="http://localhost/vb2"/>

morphistation 02-25-2005 01:26 PM

haha was thinking in a one track mind yesterday apparently... just shows how there are many ways to do things.

:squareeyed:

dtsp 03-24-2005 05:36 AM

<?php

require("http://www.url.com/forum/global.php");

?>

<html>
<head>
</head>

<body>
<?

if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];

print("<align='center'><span class='sectionheader'>Welcome back, $username!<br>");

} else {


?>

<form action='http://www.url.com/forum/login.php' method='post' onsubmit='md5hash(vb_login_password,vb_login_md5pa ssword)'>
<script type='text/javascript' src='http://www.url.com/forum/clientscript/vbulletin_md5.js'></script>

<span class="sectionheader">Username:</span>
<input type="text" class="button" name="vb_login_username" id="navbar_username" size="15" accesskey="u" tabindex="1" onfocus="if (this.value == 'User Name') this.value = '';" /><br>

<span class="sectionheader">Password:&nbsp;</span>
<input type='password' class='button' name='vb_login_password' size='15' accesskey='p' tabindex='2' /><br>
<input type='checkbox' name='cookieuser' value='1' tabindex='3' id='cb_cookieuser_navbar' accesskey='c' checked='checked' /><span class='sectionheader'>Remember Me</span><br>

<input name="submit" type='submit' class='button' accesskey='s' tabindex='4' title='Log In' value='Log In' />
<input type='hidden' name='do' value='login' />
<input type='hidden' name='forceredirect' value='1' />
<input type='hidden' name='vb_login_md5password' />
<input type="hidden" name="url" value="http://www.url.com/forum"/>
</form>
<?

}

?>
</body>
</html>

the above works for me but now i have another problem...i need it to remember the person that logged in on the non vb page. anybody got any suggestions?

Matrixgl 03-29-2005 10:26 AM

followed the instructions

Code:

chdir("/home/&&&&&&/public_html/forums/");
include('./global.php'); 
chdir("/home/&&&&&&/public_html/site/");

gives me a
Code:

Warning: main(): Failed opening '' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /index.php on line 16
on site.com/site/

vb 3.0.7

jamesyfx 04-17-2005 04:55 PM

I have a problem, when I'm logged in, it works fine.

When I'm logged out, I get
Code:

Warning: array_keys(): The first argument should be an array in /includes/functions.php on line 2128

Warning: Empty regular expression in /includes/functions.php on line 2128

I'm using 3.0.7. :P Thanks.


All times are GMT. The time now is 04:37 PM.

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.01326 seconds
  • Memory Usage 1,802KB
  • 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
  • (7)bbcode_code_printable
  • (3)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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