| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| NamePros Regular | new to PHP ... coming from ASP well i am new to PHP and have a quick question in ASP you have a global.asa which you can set and reference a session var. for example: sub session_onstart() session("ip") = request.servervariables("REMOTE_ADDR") end sub now whenever someone hits any page on my site i have a session("ip") variable i can reference. I need to do this same thing in php. (ie) i only want to load this variable once from whatever page user enters on and be able to reference it on any subsequent pages. keep in mind: I am a novice at php ![]() thanks in advance Tim
__________________ Wisconsin Apartment Listings |
| |
| | #2 (permalink) |
| Buy my domains. | PHP Code: |
| |
| | #4 (permalink) |
| NamePros Regular | basically asp has a special file called global.asa this file has a few functions in it and one of them is Sub session_onstart() this function runs whenever someone first comes to the site ex) person A google searches and clicks on a link to mypageA.asp then goes to mypageB.asp ... before he hits mypageA.asp -> session_onstart() function runs. when he then goes to mypageB.asp session_onstart() function doesn't run because it was invoked before mypageA.asp already. basically it makes it so i don't need to include a file on top of every page
__________________ Wisconsin Apartment Listings |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |