SunQuest
           PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Try It Free
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old July 30th, 2002, 03:32 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
Sessions not starting

This may have been better off in the installation forum but here goes...

I don't think my web server is corrctly starting sessions! I am using a script that works perfectly on another web server, but on mine, the session variables are always empty which makes me think that they are not registering correctly. is there anything I need to change in the php.ini?

Reply With Quote
  #2  
Old July 30th, 2002, 04:46 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Sessions not starting

How are you accessing the session variables?

Reply With Quote
  #3  
Old July 30th, 2002, 04:58 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Sessions not starting

$variable_name

I have a feeling that here may be a problem with PHP Sessions on Windows servers which is what I am using so I am now looking to find out how to resolve this if anyone can help?

Reply With Quote
  #4  
Old July 30th, 2002, 05:09 PM
Taoism Taoism is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Winnipeg, MB, Canada
Posts: 81 Taoism User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 sec
Reputation Power: 2
RE: Sessions not starting

Newer installs of PHP have
php Code:
Original - php Code
  1.  
  2. register_globals off 

in the ini file (it used to be on by default).

Having it on was a security risk.

You have a few choices. Change the php.ini on the server to be
php Code:
Original - php Code
  1.  
  2. register_globals on


or, if you can use .htaccess files, create one with:
php Code:
Original - php Code
  1.  
  2. php_flag register_globals on


or, don't touch either of those and do (this is what I would do) this in your code:

php Code:
Original - php Code
  1.  
  2. <?php
  3. if(isset($_POST['my_var_name'])){
  4.   $my_var_name=$_POST['my_var_name'];
  5. }
  6. ?>


You can also do:
php Code:
Original - php Code
  1.  
  2. <?php
  3. //taken from user notes on php.net
  4. if (!empty($_GET)) {
  5. extract($_GET);
  6. } else if (!empty($HTTP_GET_VARS)) {
  7. extract($HTTP_GET_VARS);
  8. }
  9.  
  10. if (!empty($_POST)) {
  11. extract($_POST);
  12. } else if (!empty($HTTP_POST_VARS)) {
  13. extract($HTTP_POST_VARS);
  14. }
  15. ?>


which will extract all the variables in those scopes into the local scope. (I don't like that solution myself).


Cheers,
Keith.

Reply With Quote
  #5  
Old July 30th, 2002, 05:20 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Sessions not starting

Mmm register_globals = on in my php.ini

Reply With Quote
  #6  
Old July 30th, 2002, 05:33 PM
greggory greggory is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Reims, France
Posts: 82 greggory User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Sessions not starting

Verify or Set session.auto_start to on ?

Reply With Quote
  #7  
Old July 30th, 2002, 06:14 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Sessions not starting

that's on too!

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Sessions not starting


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway