Jump to content


Photo

Pass sign in info to new window


  • Please log in to reply
7 replies to this topic

#1 cfemocha

cfemocha
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 05 October 2006 - 03:35 PM

I have a page that needs user to log in to see the contents. Inside the content there is a link which will open up in a new window. What do I need to do so the new window will recognize the user has already signed in? And how do I pass member datas pulled out from the database to the new window without using the get method (i.e. showing it in the url) ?

#2 Hi I Am Timbo

Hi I Am Timbo
  • Members
  • PipPipPip
  • Advanced Member
  • 109 posts

Posted 05 October 2006 - 03:39 PM

You could either serialize the session and pass it to the new window in a querystring, or you could use javascript and this.opener to get the data (which would be stored in a hidden or something similar).

You could also keep track of the session information in the database.

#3 brown2005

brown2005
  • Members
  • PipPipPip
  • Advanced Member
  • 943 posts

Posted 05 October 2006 - 03:49 PM

use sessions or cookies..

#4 Hi I Am Timbo

Hi I Am Timbo
  • Members
  • PipPipPip
  • Advanced Member
  • 109 posts

Posted 05 October 2006 - 03:49 PM

Ha, I suppose that would work.  I was thinking to a new site, I'm sorry.

#5 cfemocha

cfemocha
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 05 October 2006 - 04:27 PM

use sessions or cookies..


Im using sessions on the signin page (i.e. $userid = $_SESSION['user_id']; )
and my link is like <a href="newwindow.html">new window</a>

but $_SESSION['user_id'] does not seem to have been passed to the new window. Am I missing something here?

Any help is appreciated.
Thank you.

#6 Hi I Am Timbo

Hi I Am Timbo
  • Members
  • PipPipPip
  • Advanced Member
  • 109 posts

Posted 05 October 2006 - 04:30 PM

probably because newwindow.html is an html page, not php?

#7 cfemocha

cfemocha
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 05 October 2006 - 04:35 PM

oops, sorry, it is a php file.

#8 Hi I Am Timbo

Hi I Am Timbo
  • Members
  • PipPipPip
  • Advanced Member
  • 109 posts

Posted 05 October 2006 - 04:45 PM

are you doing session_start(); there too?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users