Learning PHP and MySQL
Example 14-12 Checking for magic quotes
<?php
$search = $_GET["search"];
if (!get_magic_quotes_gpc()) {
$search = addslashes($search);
}
if ($search != NULL ){
echo "The search string is: <strong>$search</strong>.";
}
else {
echo '<form method="'.$_SERVER["PHP_SELF"].'" method="GET">
<label> Search:
<input type="text" name="search" id="search" />
</label>
<input type="submit" value="Go!" />
</form>';
}
?>
Posted by on 09/25 at 03:18 PM