Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 10th, 2004, 06:43 AM
Registered User
 
Join Date: Apr 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default session - javascript

Hi,

I have a problem and I would like to ask you to help me. I have php site with sesion and from this page I open a new windov through JAVASRIPT (window. open(mysite.php, main) and new site mysite.php starts with session, but session variable on the new page mysite.php is not. If I do not use JavaSript it works OK but not with JavaSript. Could you help me.

Thanks Martin

 
Old November 11th, 2004, 03:45 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

pass the sesion id like:
"mysite.php?<?php echo SID; ?>"
or
"mysite.php?<?php echo strip_tags(SID); ?>"

use session_start(); on nextpage.php and then refer session variables
$_SESSION['var'] etc.

the page from which u paased SID should have initialised $_SESSION[]
variables.


 
Old November 17th, 2004, 06:31 AM
Authorized User
 
Join Date: Oct 2004
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to SiliconFuRy
Default

"mysite.php?sid=<?php session_id(); ?>"

sounds more correct to me

Many shoes,

Jamez/SiliconFuRy





Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript and the session object VictorVictor ASP.NET 2.0 Professional 3 April 1st, 2007 02:58 PM
How to store data in a session using javascript? chayan Classic ASP Professional 0 March 10th, 2007 10:14 AM
Accessing Session Variables in javascript subhendude Other Programming Languages 1 November 8th, 2006 11:15 AM
How To Assign Value To Session Using Javascript janice.koay Classic ASP Professional 1 May 9th, 2006 12:59 AM
Using the Session Object and JavaScript rguidry Classic ASP Professional 10 December 23rd, 2004 05:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.