| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Dec 2005 Location: up north
Posts: 577
![]() ![]() ![]() ![]() ![]() | 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. ????: NamePros.com http://www.namepros.com/programming/270389-new-to-php-coming-from-asp.html 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. Join Date: Feb 2006
Posts: 2,796
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | PHP Code: |
| |
| | #3 (permalink) |
| Domains my Dominion Join Date: Aug 2005 Location: Web 1.0
Posts: 9,552
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | It ain't difficult ![]() PHP Code:
__________________ NameNewsletter.com - free lists of available domain names ZoneFiles.net (beta) - ccTLD and gTLD droplists |
| |
| | THREAD STARTER #4 (permalink) |
| NamePros Regular Join Date: Dec 2005 Location: up north
Posts: 577
![]() ![]() ![]() ![]() ![]() | 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 |
| |
| | #6 (permalink) | ||||
| Account Closed Join Date: Nov 2006 Location: Lahore
Posts: 297
![]() |
| ||||
| |