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: 16 years ago
Size: 844 bytes
 

Contents

Class file image Download
<?php
/**
* 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/config.inc.php"); # 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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>GET</title>
</head>
<body>
<p><?=("<a href='?".$gu->url()."'>Link</a>")?></p>
</body>
</html>