sessions problem [php]
- Started
- Last post
- 8 Responses
- qaddisin
i having trouble figuring this out. im using dreamweaver's login behavior [that works] and i redirect to the proper page but i tried to use the MM_Username session variable and get nothing outputed.
im testing on a local server. any ideas. i'll try and keep searching.
- qaddisin0
also the output is an error
Notice: Undefined variable: _SESSION
which of course means the session variable is not there but i know dreamweaver creates this variable.
- enobrev0
well, dreamweaver doesn't create that var. It's a php native variable.
You could possibly have an older version of php running locally. $_SESSION didn't become available until php 4.2. Before that it was only in session specific functions or through registered global variables.
It's also possible that you don't have sessions activated on youir local setup.
I dont know enought about DW's login functions to be of any help in that area.
- qaddisin0
im using version php 4.3.4. dreamweaver creates this
$GLOBALS['MM_Username'] = $loginUsername;
and after checking phpinfo()
i found this:session.auto_start Off
is this the problem. ill try changing this or upload to the server and see what happens. humm...
- enobrev0
no you don;'t necessarily need session autostart to be on. You just need to add session_start() to the begginning of your scripts. I figure DW might be putting that in for you. IF not, just put it all the way at the top of all your files. That will start php's session functionality.
- qaddisin0
ok thanks for your time. ill try that. found this article on macromedia.
http://www.macromedia.com/devnet…
and i like your work. do you do most of the backend for all those sites. thanks again.
- enobrev0
thanks!
yeah, mostly backend stuff. All the really good looking sites in my portfolio... no design input from me whatsoever, besides maybe usability opinion.
i tried checking your stuff out but my hotel connection is really picky and annoying.
- qaddisin0
i found a better link to information on dreamweaver and login/sessions [i think your advice was right on point].
im using dw to get started and will learn logins/registration by hand after. are you freelancing or working for a company.
my site is all dynamic but i am updating the content and creating an admin area now.
that link i was talking about:
http://www.macromedia.com/suppor…
- enobrev0
all freelance all the time.