User management for the world wide web

Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

Location.php

00001 <?php
00002 require_once("GenieGate/View.php");
00015 class GenieGate_View_Location extends GenieGate_View {
00016 
00017     var $URL;
00022     function GenieGate_View_Location($url){
00023         $this->URL = $url;
00024     }
00025     
00026     function display(){
00027         ob_clean(); // Wipe out any contents.
00028         $h = $this->URL . $this->_build_params();
00029         header("Location: $h");
00030         echo "<HTML><HEAD></HEAD><BODY>";
00031         echo "If your browser does not refresh, please ";
00032         echo "<A HREF=\"$h\">Click here</A>";
00033         echo "</BODY></HTML>"; 
00034         ob_flush();
00035     }
00036     
00037     // Takes the PARAM's and, where scalar, builds a query string.
00038     function _build_params(){
00039         if(strpos($this->URL,"?")){
00040             $buf = "&";
00041         }else{
00042             $buf = "?";
00043         }
00044         foreach($this->PARAM as $p => $v){
00045             if(is_scalar($v)){
00046                 $buf .= sprintf("%s=%s&",urlencode($p),urlencode($v));
00047             }
00048         }
00049         if(strlen($buf) > 1){
00050             $buf = substr($buf,0,(strlen($buf) - 1));
00051         }else{
00052             $buf = "";
00053         }
00054         return($buf);
00055     }
00056 }
00057 
00058 ?>

DoxyGen Documentation generated by DoxyGen