Phpbb Session Integration Help

liunx

Guest
I'm trying to allow members of my forum to sign in from the pages of my website. I'm pretty sure I have the php coding correct, it just isn't working. I know very little about what I'm doing so any help is MUCH appreciated. <br /><br />Heres my problem:<br /><br />I sign with a correct user name and password and when I hit the log in button it just dumps me right to my else condition as if I weren't logged in. My code is:<br /><br />Session Management that is at the top of both the page i'm logging in from and the page I want to go to after a log in.<br /><br />define('IN_PHPBB', true);<br />$phpbb_root_path = './forums/';<br />include($phpbb_root_path . 'extension.inc');<br />include($phpbb_root_path . 'common.'.$phpEx);<br /><br />//<br />// Start session management<br />//<br />$userdata = session_pagestart($user_ip, PAGE_INDEX);<br />init_userprefs($userdata);<br />//<br />// End session management<br />//<br /> ?><br /><br /><br /><br />my forums are located in my forum directory so that part is correct. <br /><br /><br />then on the page you get taken to after a log in i have:<br /><br />if( $userdata['session_logged_in'] )<br /> {<br /> <html content><br /><br />}<br />else<br /> {<br /> echo('Please Login');<br /> }<br /><br /><br />my syntax seems to be correct I just can't get the log in to actually work.<br /><br />my form code that I'm logging in with is. (exactly as it appears on the page)<br /><br /><form action="login.php" method="post"><font color=white face=verdana size=2>Username:</font></td><br /> <td width=140><input type="text" name="username" size=15> </td><br /> </tr><br /> <tr><br /> <td width=30><font color=white face=verdana size=2>Password:</font></td><br /> <td width=140><input type="password" name="password" size=15 ></td><br /> </tr><br /> <tr><br /> <td width=60></td><br /> <td><br /> <input type="submit" value="login" name="login"></form><br /><br /><br />I've hit a major wall as I have no idea on where to go from here so any help would great.<br /><br />Thanks in advance.<!--content-->
Welcome to the forums timmy <br /><br />Sorry, I have never tried to login to any BB software other than from the BB interface.<br /><br />Maybe one of our members has done this and can give you some clues.<!--content-->
Welcome to the forums timmy.<img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
Welcome to the forum, timmy. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
Welcome to the forums, Timmy! <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/thumbup1.gif" style="vertical-align:middle" emoid=":thumbup1:" border="0" alt="thumbup1.gif" /><!--content-->
Welcome to the forums, timmy! <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/thumbup1.gif" style="vertical-align:middle" emoid=":thumbup1:" border="0" alt="thumbup1.gif" /><!--content-->
The only issue I can see is your form action, maybe.<br />Is the page you are trying to login from in the forums directory?<br /><br />If not then you need to change <br /><!--html--><div class='htmltop'>HTML</div><div class='htmlmain'><!--html1--><<span style='color:blue'>form</span> action="<span style='color:orange'>login.php</span>" method="<span style='color:orange'>post</span>"><!--html2--></div><!--html3-->to<br /><!--html--><div class='htmltop'>HTML</div><div class='htmlmain'><!--html1--><<span style='color:blue'>form</span> action="<span style='color:orange'>location of forums/login.php</span>" method="<span style='color:orange'>post</span>"><!--html2--></div><!--html3--><!--content-->
<!--quoteo(post=154722:date=Nov 7 2005, 05:23 PM:name=TCH-Dick)--><div class='quotetop'>QUOTE(TCH-Dick @ Nov 7 2005, 05:23 PM) <a href="http://www.totalchoicehosting.com/forums/index.php?act=findpost&pid=154722"><img src='http://www.totalchoicehosting.com/forums/style_images/1/post_snapback.gif' alt='*' border='0' /></a></div><div class='quotemain'><!--quotec-->The only issue I can see is your form action, maybe.<br />Is the page you are trying to login from in the forums directory?<br /><br />If not then you need to change <br /><!--html--><div class='htmltop'>HTML</div><div class='htmlmain'><!--html1--><<span style='color:blue'>form</span> action="<span style='color:orange'>login.php</span>" method="<span style='color:orange'>post</span>"><!--html2--></div><!--html3-->to<br /><!--html--><div class='htmltop'>HTML</div><div class='htmlmain'><!--html1--><<span style='color:blue'>form</span> action="<span style='color:orange'>location of forums/login.php</span>" method="<span style='color:orange'>post</span>"><!--html2--></div><!--html3--><!--QuoteEnd--></div><!--QuoteEEnd--><br /><br /><br />my file structure is<br /><br /><br />public_html<br />--index.php (page logging in from)<br />--login.php<br />forums<br />--index.php (forums index)<br /><br /><br />p.s - thanks for the welcomes guys. been a customer for awhile now, just never posted.<!--content-->
Welcome to the forums!<!--content-->
ok i got it workin. I reinstalled my forum and it worked. so now my next question is how do I change it so when a user logs in they are taken to a page within my site instead of the forum?<!--content-->
Is there somewhere in your login script where you could put a redirect?<!--content-->
 
Back
Top