PHP Classes
Icontem

File: example.basic.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Joshua Townsend  >  Request Data  >  example.basic.php  
File: example.basic.php
Role: Example script
Content type: text/plain
Description: Example of basic use
Class: Request Data
Retrieve and process request parameters
 

Contents

Class file image Download
<?php
// Basic examples of use
require "request.class.php";

$request = new request();

$id $request->get_int("id"); // Get the variable "id" from the $_REQUEST array as an integer, or, if it doesn't exist, return 0

$name $request->get_string("name""gp"); // Get the variable "name" from the $_POST array if it exist, if it doesn't exist, the $_GET array, or, if it exists in neither, return ""

$fullname $request->get_string("fullname""gp""Smith"); // Same as above for the "fullname" variable, but return "Smith" if it is not found

$host $request->get_string("HTTP_HOST""s"); // Get the "HTTP_HOST" variable from the $_SERVER array.  See also the use of request::get_header() for HTTP headers through $_SERVER
?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products