Learn Php session | Php redirect | Php replace | Php program

  • 0 Replies
  • 1110 Views
*

Sharmait007

  • Newbie
  • *
  • 8
  • +0/-0
    • View Profile
Learn Php session | Php redirect | Php replace | Php program
« on: September 09, 2011, 03:38:25 AM »
Php Redirect:
If you have moved your pages, you can use PHP to perform a redirect to your new page.
The search engine friendly way of redirecting is the 301 redirect. In PHP, this is implemented as follows:
<?
Header("Location:http://www.example.com");
?>

SESSIONS:
In PHP session is used to  store  the user information on the server for later use (ex: username, password). And  this session information is temporary  storge and it’s deletd when user log out the page.
               Sessions  are created by using  a Unique Identification Number (UID) for each visitor .This helps to identify the user when their visiting on the web page.By using sessions we can increase the security to the web pages.Only authorized  user can able to acces the web page.

Start a PHP Session:
<?php
session_start();
?>

Storing a Session :

<?php
session_start();
$_SESSION['session name'] = value;
?>

Destroy a  Session:
<?php
session_destroy();
?>

 Or
    unset($_SESSION['session name']);

PHP has the following built in string manipulation function to replace strings:
•   str_replace
•   str_ireplace
•   preg_replace
•   strtr

str_replace
•   This function replaces all occurrences of the search string with the replacement string. 
str_ireplace
•   This function is very similar to str_replace but it is case-insensitive.
 preg_replace
•   This function performs a regular expression search and replace.
« Last Edit: September 09, 2011, 07:44:36 AM by Webhelpforums »

 




See Our Webmaster Tools for Windows and Mac

A1 Sitemap Generator
      
A1 Website Analyzer
      
A1 Keyword Research
      
A1 Website Download
      
A1 Website Search Engine
      
A1 Website Scraper