function clear($str){
return mysql_escape_string(strip_tags(trim($str)));
}
function redirect($url=false){
if(!$url)
$url = $_SERVER['PHP_SELF'];
if(!headers_sent())
header("Location:$url");
else
debug('Redirect','Redirect:Said that headers are already sent!',D_FATAL);
exit;
}
function is_id($id){
if( preg_match("/([^0-9 ]+)/",$id)){
return false;
} else {
return $id;
}
}
function getUrlContent($url){
$handle = @fopen($url, "r");
if ($handle) {
while (($buffer = fgets($handle, 4096)) !== false) {
$content.=$buffer;
}
if (!feof($handle)) {
echo "Error: unexpected fgets() fail\n";
}
fclose($handle);
}
return $content;
}
?>
About AUA