Page 2 of 2

Re: Login integration

Posted: Mon Sep 02, 2013 5:52 pm
by Altutto
But is maintaining it into the /test/test folder right?

Re: Login integration

Posted: Mon Sep 02, 2013 7:26 pm
by Lumpy Burgertushie
Altutto wrote:But is maintaining it into the /test/test folder right?
what does that mean? what are you trying to do?
I thought the object was to test how to integrate your login between the board and some other script you have on your site.

if so, then you need to put the login script wherever you want it to be and then edit the root path in it accordingly.


ropbert

Re: Login integration

Posted: Mon Sep 02, 2013 7:45 pm
by Altutto
Yes, I meant that, sorry, I'm not English.
Anyway, the code still doesn't work and it shows the same error :(

Re: Login integration

Posted: Mon Sep 02, 2013 7:49 pm
by Lumpy Burgertushie
post exactly what is in your current test/test/index.php file


robert

edit:

assuming that your set up is ;

your domain.com/f/

yourdomain.com/test/test/index.php

the root path should be just as was posted above.

../../f/

I just tested this here:

phpbbace.com/test/test/index.php

which the root path goes back to the root then to the folder where my board is installed:

../../board/

and your script logs me in and shows me the welcome message.

if you access that page it should show you a please login message.
try it and see.


ropbert

Re: Login integration

Posted: Mon Sep 02, 2013 7:59 pm
by Altutto
It shows me this:
[phpBB Debug] PHP Warning: in file [ROOT]/includes/session.php on line 1042: Cannot modify header information - headers already sent by (output started at /home/cyberosi/public_html/phpbbace.com/test/test/index.php:1) [phpBB Debug] PHP Warning: in file [ROOT]/includes/session.php on line 1042: Cannot modify header information - headers already sent by (output started at /home/cyberosi/public_html/phpbbace.com/test/test/index.php:1) [phpBB Debug] PHP Warning: in file [ROOT]/includes/session.php on line 1042: Cannot modify header information - headers already sent by (output started at /home/cyberosi/public_html/phpbbace.com/test/test/index.php:1) Please login!

Re: Login integration

Posted: Mon Sep 02, 2013 8:04 pm
by Lumpy Burgertushie
I know why it is showing that error and I fixed it. please try again. what I don't know is why it did not show the error to me.
refresh your browser a couple of times if it doesn't work for you.

oh well, the gremlins are at it again.


robert

Re: Login integration

Posted: Mon Sep 02, 2013 8:11 pm
by Altutto
Now it works, it shows me the text "please login" :)
thank you!
Please could you repeat the code that you used?

Re: Login integration

Posted: Mon Sep 02, 2013 8:22 pm
by Lumpy Burgertushie
Altutto wrote:Now it works, it shows me the text "please login" :)
thank you!
Please could you repeat the code that you used?
I used your code but changed the root path to what was posted above.
here is is exactly as you need to put in your index.php file:

Code: Select all

<?php
    define('IN_PHPBB', true);
    $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../../f/';
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include($phpbb_root_path . 'common.' . $phpEx);

    $user->session_begin();
    $auth->acl($user->data);
    $user->setup();

    if ($user->data['user_id'] == ANONYMOUS)
    {
       echo 'Please login!';
    }

    else
    {
       echo 'Thanks for logging in, ' . $user->data['username_clean'];
    }
    ?>

Re: Login integration

Posted: Mon Sep 02, 2013 8:24 pm
by Altutto
Thank you very much, I'm going to try it tomorrow :)

Re: Login integration

Posted: Mon Sep 02, 2013 8:25 pm
by Lumpy Burgertushie
Altutto wrote:Thank you very much, I'm going to try it tomorrow :)
why not today? :D it will only take you 2 minutes and then you will know.


robert

Re: Login integration

Posted: Mon Sep 02, 2013 8:32 pm
by Altutto
Yes, you're right ;)
It works!!!!!!! :D
Finally! I tried to make it work for days!
Thank you very much!

Re: Login integration

Posted: Wed Sep 04, 2013 6:17 pm
by Altutto
Sorry again, I've got an other problem :roll:
My script should extract a number from the column livello_ef into the table avphpbb_users and compare it with the column livello_ef into the table Fluent_english, display the matching sentence and checking if it's right.
But it shows "error!".

Code: Select all

<!-- INCLUDE overall_header.html -->

<h2>Fluent English</h2>
<?php
    define('IN_PHPBB', true);
    $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../../f/';
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include($phpbb_root_path . 'common.' . $phpEx);

    $user->session_begin();
    $auth->acl($user->data);
    $user->setup();

    if ($user->data['user_id'] == ANONYMOUS)
    {
       echo 'Please login!';
       die();
    }

    else
    {
       echo 'Logged in!';
$nomeutente="data['user_id']";
    }
$connessione=mysql_connect("localhost", "altutto", "password");
$selezione_db=mysql_select_db("my_altutto", $connessione);
$progressi = "SELECT livello_ef FROM avphpbb_users WHERE id =='$nomeutente';";
$ottieni = "SELECT inglese FROM Fluent_english WHERE livello_ef=='$progressi';";
$mostra ="mysql_query($ottieni);";
       if (!$ris_news) {
 
           exit ('<p> Error!' . mysql_error() . '</p>');
 
                }
 
   while ($news= mysql_fetch_array($ris_news))  
 
   {
 

     echo "<p>Traduci: ".$news['english*']."</p>" ;
 
   }
 
if($_POST['traduzione']==''){echo '<form action="index.php" method="POST">
<label><input type="text" id="traduzione"></label>
<input type="submit" value="Conferma">
</form>';
}
else{ $controlla = "SELECT italiano** FROM Fluent_english WHERE livello_ef=='$progressi';";
$controllo_alternativo = "SELECT italiano_alt*** FROM Fluent_english WHERE livello_ef=='$progressi';";
if($_POST['traduzione']=='$controlla' or $_POST['traduzione']=='$controllo_alternativo'){$aggiungi = "$progressi++";
$query = "UPDATE avphpbb_users SET livello_ef='$aggiungi' WHERE id = data['user_id']"; }
else{echo 'Risposta errata!';}
}
?>
<!-- INCLUDE jumpbox.html -->
<!-- INCLUDE overall_footer.html -->
*the column where the sentences to display are.
**the column where the correct translations are.
***the column where there's an alternative correct translation.