PHP Classes

File: test_get.php

Recommend this page to a friend!
  Classes of Bimal Poudel   GET   test_get.php   Download  
File: test_get.php
Role: Example script
Content type: text/plain
Description: Example file
Class: GET
Build URLs from a list of parameters
Author: By
Last change:
Date: 15 years ago
Size: 844 bytes


Class file image Download
* This file is hightly useful to handle $_GET parameters, specially in a loop,
* while buildining the pagination type links.
* When you assign a same key again, it will overwrite it and this is the good aspect of the script.

define('LOGIN_NOT_REQUIRED', true); # Access without logging in
require_once("../classes/"); # Defines __autoload()

# gu => Get URL parameters

$gu = new GET($_GET);

$gu->add('k', 'key');
$gu->add('v', 'value');
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<p><?=("<a href='?".$gu->url()."'>Link</a>")?></p>