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: 260

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: 260

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 About foxycart
0 venkatadapa 5 Fri Jul 30, 2010 10:02 am
venkatadapa View latest post
No new posts How to change the mysql storage engine from MyISAM to innodb
1 aababu 10 Fri Jul 30, 2010 9:57 am
venkatadapa View latest post
No new posts How can we increase the execution time of a php script?
0 samir 6 Fri Jul 30, 2010 4:15 am
samir View latest post
No new posts Get no of days between two dates & current dates using M
0 samir 4 Fri Jul 30, 2010 4:09 am
samir View latest post
No new posts What are the different types of errors in php
0 samir 6 Fri Jul 30, 2010 4:00 am
samir View latest post
No new posts How to remove a value in an array using javascript
0 samir 10 Thu Jul 29, 2010 7:27 am
samir View latest post
No new posts Agile methodology plays vital role in software development
0 venkatadapa 7 Thu Jul 29, 2010 7:20 am
venkatadapa View latest post
No new posts How to get complete information about $_SERVER variable
0 Sanjana 15 Wed Jul 28, 2010 6:58 am
Sanjana View latest post
No new posts DNL Reader for php website
0 Mike 22 Mon Jul 26, 2010 12:33 pm
Mike View latest post
No new posts Use mysql_real_escape_string() function to avoid mysql injec
0 venkatadapa 26 Mon Jul 26, 2010 11:05 am
venkatadapa 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