Query String = /three/woof Variable one = Variable two = Variable three = woof Variable four =
Set "three" to meow
Set "three" to woof
Foreslashes(/) are ignored in backticks (`).
Unset variable "three"
Set variables one, two, and four to fish,blue and red
Unset variables one, two, and four
require_once 'class_saqs.php'; //Init SAQS if(!isset($saqs)) { $saqs = new saqs; }
echo set_qstr_value('three','`this/contains/slashes`');
<?php
error_reporting(E_ALL);
require_once 'class_saqs.php';
$SSN = $_SERVER['SCRIPT_NAME'];
if(!isset($saqs)) {
$saqs = new saqs;
}
echo <<<HD
<pre>
Query String = {$saqs->get_qstr()}
Variable <b>one</b> = {$saqs->get_qstr_value('one')}
Variable <b>two</b> = {$saqs->get_qstr_value('two')}
Variable <b>three</b> = {$saqs->get_qstr_value('three')}
Variable <b>four</b> = {$saqs->get_qstr_value('four')}
</pre>
<p>
<a href="{$SSN}{$saqs->set_qstr_value('three', 'meow')}">Set "three" to meow</a><br>
<a href="{$SSN}{$saqs->set_qstr_value('three', 'woof')}">Set "three" to woof</a><br>
<a href="{$SSN}{$saqs->set_qstr_value('three', '`this/contains/slashes`')}">
Foreslashes<sup>(/)</sup> are ignored in backticks <sup>(`)</sup>.</a><br>
<a href="{$SSN}{$saqs->set_qstr_value('three', '')}">Remove variable "three"</a>
</p>
<p>
<a href="{$SSN}{$saqs->set_qstr_value( array('one' => 'fish', 'two' => 'blue', 'four' => 'red') )}">
Set variables one, two, and four to fish,blue and red</a><br>
<a href="{$SSN}{$saqs->set_qstr_value( array('one' => '', 'two' => '', 'four' => '') )}">
Unset variables one, two, and four</a>
</p>
<p>
<a href="http://example.com/id.php{$saqs->get_qstr()}" target="_blank">External Site (w/ query string)</a>
</p>
HD;
?>
Copyright © 2007, 2008 Matthew Headlee
SAQS (Super Awesome Query Stringing) is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
SAQS (Super Awesome Query Stringing) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.