Jump to content

[SOLVED] PHP Sessions! Help!


evie

Recommended Posts

I am trying  to pass session variables from one web page to the other throughout my website but it seems impossible..

 

I am using php 4.3.1 and put following code for session registration

session_start();

 

$_SESSION["$username"]=$_POST["username"];

 

Additionaly, i tried to append session_register("username") and global $username; to the code, but unfortunately to no avail.

 

Could you please help me out? Maybe I need to change some settings in my php.ini file?

So far, php.ini has following content:

 

register_globals = off

allow_url_fopen = off

expose_php = Off

max_input_time = 60

variables_order = "EGPCS"

extension_dir = ./

upload_tmp_dir = /tmp

precision = 12

SMTP = relay-hosting.secureserver.net

 

session.save_handler = files

session.use_cookies = 1

session.name = FOO

session.auto_start = 0

session.cookie_lifetime = 60

session.cookie_path = c:\temp

session.cookie_domain =

session.serialize_handler = php

session.gc_probability = 1

session.gc_maxlifetime = 1440

session.referer_check =

session.entropy_length = 0

session.entropy_file =

session.cache_limiter = private

session.cache_expire = 180

session.use_trans_sid = 1

 

Any help would be greatly appreciated, cause I have literally spent hours for this matter!

Evie

Link to comment
https://forums.phpfreaks.com/topic/64181-solved-php-sessions-help/
Share on other sites

U dont need the $ sign if isnt your intend to call a variable:

 

normal

$_SESSION["username"]=$_POST["username"];

 

if calling a variable

$_SESSION[$username]=$_POST["username"];

 

Anyway when using double quotes it returns the variable so if u were calling it, thats not causing your problem, i guess.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.