Topic: Printing username and password as <PARAM> for a Java-applet

Hi,

is there please a way to print the username and the password
of a logged in user
at a web page?

I have a small multiplayer card game as a Java applet and would like
to avoid the need for the users to authenticate twice (first entering the
username + password into the punBB's web form, and then entering
the same into the text fields of my applet) and thus I would like to print
the username and pasword as

   <APPLET ...>
    <PARAM NAME="username" VALUE="....." />
    <PARAM NAME="password" VALUE="....." />
   </APPLET>

and then just fetch them by the applet (using getParameter() function).

Regards
Alex

http://preferans.de/ - russian card game

2 (edited by afarber 2005-07-21 10:57)

Re: Printing username and password as <PARAM> for a Java-applet

My current problem is - I've followed http://punbb.org/docs/dev.html#integration
and have put the following index.php file at the top of my website:

<HTML>
<HEAD>
<TITLE>Test integration</TITLE>
</HEAD>
<BODY>

<?php
define('PUN_ROOT', './forum/');
require PUN_ROOT.'include/common.php';
//print_r($pun_user);
?>

<P>
Hello <?php echo pun_htmlspecialchars($pun_user['username']); ?>!
</P>

</BODY>
</HTML>

But it does only create this page:

<html><body></body></html>

In the error_log I don't see anything. All normal punBB pages do work.

I've searched the punBB scripts for this string:

fgrep -r '<html><body></body></html>' forum/

but have found nothing, is it coming from PHP itself? (I don't know PHP well,
but I'm reading the "PHP Cookbook" currently in order to catch up...)

And when I comment the first 2 PHP-lines above, then the output is
as expected "Hello ", but the $pun_user is of course not initialized sad
(and I see in the error_log

[Thu Jul 21 12:57:49 2005] [error] PHP Fatal error:  Call to undefined function pun_htmlspecialchars() in /htdocs/index.php on line xx

)

Regards
Alex

http://preferans.de/ - russian card game

3 (edited by afarber 2005-07-21 12:13)

Re: Printing username and password as <PARAM> for a Java-applet

I've also tried this code:

<?php

define('PUN_ROOT', './forum/');
echo "PUNROOT = " . PUN_ROOT . "<BR>\n";

$filename = PUN_ROOT . 'include/common.php';

if (is_readable($filename)) {
       echo "The file $filename is readable";
} else {
       echo "The file $filename is NOT readable";
}
//require $filename;

?>

And when the last line above is commented, it works as expected:

PUNROOT = ./forum/
The file ./forum/include/common.php is readable

But when I remove the comment before require, I get an empty page:

<html><body></body></html>

Funnily all the other PunBB 1.2.6 pages work fine.
What could be wrong with require please?

Regards
Alex

http://preferans.de/ - russian card game

Re: Printing username and password as <PARAM> for a Java-applet

Ahh nevermind - for whatever reason it is not allowed to have <HTML> etc. code before the

<?php
define('PUN_ROOT', './forum/');
require PUN_ROOT.'include/common.php';
?>
http://preferans.de/ - russian card game