Senior & Expert PHP Developers Discussion Forum by Nyros Technologies

HIRE PHP Expert Developers Programmers Coders From India
PHP .Net Ruby on Rails Developers Community, Nyros Technologies, Kakinada
 
Log in  or IF not a member please REGISTER
Username:
Password:   


Keyword
Log in | Profile 

2 issues with integrated login/logout on site homepage.

 
Post new topic   Reply to topic    Senior & Expert PHP Developers Discussion Forum by Nyros Technologies Index -> phpBB
View previous topic :: View next topic  
Author Message
NeoTez



Joined: 27 May 2009
Posts: 2

PostPosted: Wed May 27, 2009 10:56 am    Post subject: 2 issues with integrated login/logout on site homepage. Reply with quote

Hello,

I'm have my forums located at www.mysite.com/forums and and trying to have a login/logout box on www.mysite.com

Here is the code I am using:


<?php

define('IN_PHPBB', true);
$phpbb_root_path = '../forums/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

if($user->data['is_registered'])
{
echo("Hi " . $user->data['username'] . "!    <a href=" . $phpbb_root_path . 'ucp.php?mode=logout&redirect=login.php' . '&sid=' . $user->data['session_id'] . ">Logout?</a>");
}
else
{
echo('<br><form action="/forums/ucp.php" mode="login" method="post" enctype="multipart/form-data">
<label for="username">Username: </label><input type="text" name="username" size="10" />
<label for="password">Password: </label><input type="password" name="password" size="10" />
<input type="hidden" name="redirect" value="login.php" />
<input type="submit" value="Login" name="login" />
</form>');
}
?>

login.php is located in the forum root.

Problem 1:

The redirect to login.php after login works fine, but the redirect to login.php after logout doesn't work. It just redirects to the forum main.

Problem 2:

I need these 2 redirects to be instant, instead of showing the normal PHPbb login/logout pages first. This is because I am putting the login.php file in an iframe on my homepage. How can I make them instant redirects?

Thanks in advance,

Paul
Back to top
View user's profile Send private message
samir



Joined: 12 Nov 2007
Posts: 231

PostPosted: Fri May 29, 2009 12:12 pm    Post subject: Reply with quote

paul , do u mean that you need a single login and logout , so that when you logout from the mail site you automatically logout from the froum and vice versa?????
Back to top
View user's profile Send private message
NeoTez



Joined: 27 May 2009
Posts: 2

PostPosted: Fri May 29, 2009 7:01 pm    Post subject: Reply with quote

No, I just want a login/logout box on my main site that provides the same functionality as the main PHPbb one.
Back to top
View user's profile Send private message
samir



Joined: 12 Nov 2007
Posts: 231

PostPosted: Mon Jun 01, 2009 7:25 am    Post subject: Reply with quote

ok , then you need to maintain separate login / logout for your main site , and a separate login / logout for the forum site. i dont undertstand the use of iframe in the login page.............!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Senior & Expert PHP Developers Discussion Forum by Nyros Technologies Index -> phpBB
Page 1 of 1

 latest topics 
 Topics   Replies   Author   Views   Last Post 
No new posts how to add 20 minutes in past date
2 Mike 21 Wed Mar 10, 2010 1:29 pm
Mike View latest post
No new posts display the date in given range
3 Mike 45 Wed Mar 10, 2010 5:21 am
AnilKumar View latest post
No new posts Get the random values from mysql
0 AnilKumar 6 Wed Mar 10, 2010 4:43 am
AnilKumar View latest post
No new posts About Expression Engine
1 Thirupathi 69 Mon Mar 08, 2010 2:31 pm
nih View latest post
No new posts content type=text/html and and image/jpeg in same php file?
3 Mike 76 Fri Mar 05, 2010 5:16 am
AnilKumar View latest post
No new posts how to create xls file using mysql and php?
4 AnilKumar 2786 Fri Mar 05, 2010 5:08 am
AnilKumar View latest post
No new posts Who Expert can do this
0 ismaelhaider 45 Tue Mar 02, 2010 10:53 am
ismaelhaider View latest post
No new posts online Remote printing through php
1 new2it 51 Mon Mar 01, 2010 2:10 pm
new2it View latest post
No new posts Php script to display the days between two dates?
0 Thirupathi 40 Fri Feb 26, 2010 10:49 am
Thirupathi View latest post
No new posts About PEAR in php?
0 Thirupathi 31 Thu Feb 25, 2010 7:12 am
Thirupathi View latest post





Hire an expert PHP developer / coder / programmer or development team from India now!!

Other Forums : Ruby on Rails   ::   .Net   |   Free unlimited HTML CSS Joomla Wordpress Drupal templates download

Nyros Technologies   |   Developers Blog   |   Kakinada City Portal   |   About PHP Experts   |   More