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

Started by Sharmait007, September 09, 2011, 03:38:25 AM

Sharmait007

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.

More About Our Webmaster Tools for Windows and Mac

HTML, image, video and hreflang XML sitemap generatorA1 Sitemap Generator
      
website analysis spider tool for technical SEOA1 Website Analyzer
      
SEO tools for managing keywords and keyword listsA1 Keyword Research
      
complete website copier toolA1 Website Download
      
create custom website search enginesA1 Website Search Engine
      
scrape data into CSV, SQL and databasesA1 Website Scraper