Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.