Recently in PHP
Sessions are a way to store data on the server rather than in a cookie on the clients computer. One problem with sessions, is that they work for one visit only, whereas cookies can track information from one session to another by using the time() paramater. It's up to you, to decide what works best for your website. Just like with cookies you have add this session creation before any other code on your page.
To create a session in php you write the following:
<?php
session_start( );
?>
<html>
<head>
<title>Page Title</title>
<head>
<body>
Once the session has been started, data can be added to the session by using the $_SESSION variable. To create, a username variable with a value of "hockeyFanatic":
Note: $_SESSION is what is considered to be a php superglobal variable and is available at all times.
More : PHP and sessions.
Working with cookies in php is rather simple, as is working with php in general.Cookie Basics:
Cookies are text files used to store data on a client's computer, allowing the ability to store visitor data during their visit, or across multiple visits. They are most commonly used for personalizing a site for the visitor, by storing user information so they don't need to log in every time they visit and have many other uses since you store almost any data in a cookie.
Creating, reading and deleting cookies is very simple to do with PHP.
Creating a cookie:
Before you start, there is one important rule: The cookie code must be the first line of your php document unlike with javascript. It must be before the head of your page, and before any other code on the page. If not, you will get a "Headers already sent" error. So to set a cookie, your page should look like this:
More : PHP and working with Cookies.
If you need to pass one single $var from page to page, this would be the most simple of ways to do it using php. Which also results in very little code for handling it.First create the url with the var attached. As so.
http://www.yoursite.com?querystring
Notice there's no assignment using an equal sign as you'd normally do.(Like this)
http://www.yoursite.com?str=querystring
Now we have to read the query string upon page change.
More : Simple and quick php Querystring.
2whoa.com - NEW!!
Home
jQuery
Javascript
Archives
MLB Wallpapers
NFL Wallpapers
NBA Wallpapers
NHL Wallpapers
Flames Wallpaper
Watch Live Games!
NHL
NBA
Soccer
NFL
and more..
BMW, Toyota, Volvo, Saab, Audi, Nissan Mercedes, Volvo, Nissan,Volvo Volvo Volvo Honda, Acura, Honda, Acura Forerunner, SUV, Volvo, Mercedes, Toyota
Volvo, Toyota, Volvo, Saab, Audi, Nissan Mercedes, Volvo, Nissan,Volvo Volvo Volvo Honda, Acura, Honda, Acura Forerunner, SUV, Volvo, Mercedes, Toyota
Home
jQuery
Javascript
Archives
MLB Wallpapers
NFL Wallpapers
NBA Wallpapers
NHL Wallpapers
Flames Wallpaper
Watch Live Games!
NHL
NBA
Soccer
NFL
and more..
BMW, Toyota, Volvo, Saab, Audi, Nissan Mercedes, Volvo, Nissan,Volvo Volvo Volvo Honda, Acura, Honda, Acura Forerunner, SUV, Volvo, Mercedes, Toyota
Volvo, Toyota, Volvo, Saab, Audi, Nissan Mercedes, Volvo, Nissan,Volvo Volvo Volvo Honda, Acura, Honda, Acura Forerunner, SUV, Volvo, Mercedes, Toyota


