how do I use this?

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

try this first:

create a new file "sessiontest.php" and put it on your webserver. Quit your browser.

Put this code into the "sessiontest.php":

Code: Select all

<?php
session_start();

if(isset($_GET["do"])) {
	$_SESSION["test"]++;
	header("Location: ".$_SERVER['PHP_SELF']);
}


?>
<html>
<head>
<title>Session Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
Click for <a href="sessiontest.php?do=<?php echo intval($_SESSION["test"]) ?>">loading</a> session test!
<?php echo (isset($_SESSION["test"])) ? "<br><br>session var is set (".$_SESSION["test"].")" : "no session set"; ?>
</body>
</html>
It should count up 1 every time you click the link.


Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

User check is neccessary in the hole script. NEVER DISABLE THIS!!! This won't help you. :cry:

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
(Murphy)
Posts: 7
Joined: Fri 7. Nov 2003, 08:54

Post by (Murphy) »

The session test works fine...
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

try to insert the following code in your login.php - beste place is at line 193:

Code: Select all

&nbsp;<?php echo "USER-ID: ".$_SESSION["wcs_user_id"] ?>
First time this should be set to nothing - after successful login this should be your user-ID.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
(Murphy)
Posts: 7
Joined: Fri 7. Nov 2003, 08:54

Post by (Murphy) »

It does not show any ID after trying to log in...

(thx for this real time support, btw ;-) )
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

Yeah, that is the problem. It does not register the neccessary session vars.

But why?
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
(Murphy)
Posts: 7
Joined: Fri 7. Nov 2003, 08:54

Post by (Murphy) »

If I was a real experienced php-programmer I would have a clue... But I am not, so I don't have one... sorry :roll:
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

Here my next try for you:

Extend differences beginning at line 71 of login.php:

Code: Select all

	if($login_passed) {
		// workaround for possible session register problems???
		$_SESSION["wcs_user"]			= $wcs_user;
		$_SESSION["wcs_pass"]			= $wcs_pass;
		$_SESSION["wcs_user_name"]		= $wcs_user_name;
		$_SESSION["wcs_user_id"]		= $wcs_user_id;
		$_SESSION["wcs_user_aktiv"]		= $wcs_user_aktiv;
		$_SESSION["wcs_user_rechte"]	= $wcs_user_rechte;
		$_SESSION["wcs_user_email"]		= $wcs_user_email;
		$_SESSION["wcs_user_avatar"]	= $wcs_user_avatar;
		$_SESSION["wcs_user_logtime"]	= $wcs_user_logtime;
		$_SESSION["wcs_user_admin"]		= $wcs_user_admin;
		$_SESSION["wcs_user_thumb"]		= $wcs_user_thumb;
	
		/*
		session_register(	"wcs_user", "wcs_pass", "wcs_user_name", "wcs_user_id",
							"wcs_user_aktiv", "wcs_user_rechte", "wcs_user_email",
							"wcs_user_avatar", "wcs_user_logtime", "wcs_user_admin", "wcs_user_thumb");
		*/
		//Schreiben der Login-Daten in Datenbank
Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
(Murphy)
Posts: 7
Joined: Fri 7. Nov 2003, 08:54

Post by (Murphy) »

What I do not understand:

As the system does not log me in, I am not forwarded to phpwcms.php - it is logical that far...

BUT!

Why does login.php show the user "webmaster" as being online?!
(Murphy)
Posts: 7
Joined: Fri 7. Nov 2003, 08:54

Post by (Murphy) »

STRRRRRRRRRIKE!

It works!

Thank you :-)
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

This is initially set in login.php on first load.
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
itsu
Posts: 8
Joined: Thu 6. Nov 2003, 15:38

Post by itsu »

Wow It worked now!!
thanks.
:D
moe
Posts: 4
Joined: Sun 9. Nov 2003, 22:44

Post by moe »

still cant login :(

php4.3.4 installed
session creation works
modified login.php as shown

I login as webmaster with password "pass"
user webmaster online but redirects me to login.php

I try to login again -----> script shows "Errors during login!"

wtf?
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

Please check everything again!

It have to work (i hope ;-)) - I have tested the login process on more than 20 machines and 8 different PHP versions (4.2.1, 4.2.2, 4.2.3, 4.3.0, 4.3.1, 4.3.2, 4.3.3, 4.3.4) and 4 platforms (2000/XP/Suse7.3/8.1/RedHat 7.3/MacOSX) :!:

The login form is case sensitive.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
moe
Posts: 4
Joined: Sun 9. Nov 2003, 22:44

Post by moe »

nope....sorry...it doesnt work for me.

I tried it again, and now I even cant login, i.e "Errors during login!" and no user is shown as "online"

damn
Post Reply