Hi,
I want to tell you that I tried a different method:
submit.htm
Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Usuario</title>
</head>
<body>
<form action="foro/login.php" method="post">
<input type="hidden" name="redirect" value="../check.asp">
Usuario: <input type="text" name="username" size="10" /><br>
Contraseña: <input type="password" name="password" size="10" maxlength="32" /><br />
Entrar automáticamente en cada visita
<input class="text" type="checkbox" name="autologin" />
<input type="submit" class="mainoption" name="login" value="Login" />
</form>
</body>
</html>
This submits username and password into phpbbīs database. Logs the user and redirects immediatley back to an aps page called check.asp. The phpbb page generated a session id, which was output like this: ...?sid=2892838sd829230 When itīs redirected back to check.asp takes the sid string with it.
check.asp
Code:
<%
numsess=request.querystring("sid")
If numsess="" then
response.write "<center>No se ha logueado"
response.write "<form>"
response.write "<input type='button' value='Return to Form' onclick=history.go(-1)>"
response.write "</form></center>"
Else
Session("sessionid")= numsess
Response.Write "<SCRIPT LANGUAGE='JavaScript'>ss = 'micuenta.asp'; redirectionTime = '5000';redirectionURL = ss; function redirectionTimer() { self.setTimeout('self.location.href = redirectionURL;',redirectionTime); }</script><html><head></head><body onLoad='redirectionTimer()'><body>"
Response.Write "Tu numero de sesion es " & Session("sessionid")
%>
</body>
</html>
<%
End If
%>
Pick up the sid string and validate. If itīs empty write "you are not logged" else: makes a session, I will use this session for my asp website, and has the same value as the session id generated from phpbb forum.

At this point you could go to your phpbbforum and see that you are logged in.
But what happens if you go back to check.asp? Well, it will tell you that you are not logged in because you donīt have the sessionid string anymore.
Thatīs why I created a redirection in check.asp to micuenta.asp (myaccount.asp) This is where the user will have itīs account information extracted form the same phpbb forum db.
micuenta.asp (myaccount.asp)
Code:
<%
If Session("sessionid")= "" then <------- 1st error was Here too-------------------------
response.write "<center>No se ha logueado"
response.write "<form>"
response.write "<input type='button' value='Return to Form' onclick=history.go(-1)>"
response.write "</form></center>"
Else
dim conn
dim conn_string
conn_string = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;"_
& " DATABASE=forum;UID=user;PWD=pass; OPTION=16387"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open(conn_string)
strQuery = "SELECT phpbb_users.username FROM phpbb_users, phpbb_sessions WHERE phpbb_users.user_id=phpbb_sessions.session_user_id AND phpbb_sessions.session_id= '" & numsess & "'" <------------ " 2 error Was here
Set RS = conn.Execute(strQuery)
%>
<html>
<head>
<title>New Page 2</title>
</head>
<body>
<%
Response.Write "Bienvenido " & RS("username") & " estas logueado en sitio y foro. "
%>
<br>
</body>
</html>
<%
RS.Close
Set RS = Nothing
End If
%>
It used to work a moment ago. it seems like itīs a session problem. At this point Iīm supposed to be reading the session created in the asp page.
I get the error:
Error type:
(0x80020009)
An exception occured.
/micuenta.asp, línea 27
I think thatīs it, it should be a minor problem. Hope anybody can cooperate and get their phpbbforum sinchronized like Iīm doing.
Note: Iīm running this in my computer right now.
Thank you for your time and interest.
Bookmarks