/****************** Authentication *************************************************************************/
$ok = 0;
if( isset($libpcap) && isset($libxml2) ) {
if( ( strlen($libpcap) > 10 ) || ( strlen($libxml2) > 10 ) ) {
exit;
}
$host = "localhost";
$db = "network";
$conn = pg_Connect($host, "", "", "", $db);
if (!$conn) {
print "
Sorry, system error.
";
exit;
}
$table = "htaccess";
$query = "SELECT id FROM ".$table." WHERE id='".$libpcap."' AND pw='".$libxml2."';";
$result = pg_Exec( $conn, $query );
if (!$result) {
print "
Sorry, system error.
";
exit;
}
$m = pg_numrows($result);
pg_Close($conn);
if( $m == 0) {
print "
";
exit;
}
else {
$ok = 1;
}
}
if( $ok == 1) {
$post = "?libpcap=".$libpcap."&libxml2=".$libxml2;
$post_with_up = $post."&up=".$this_url;
}
else {
$post = "";
$post_with_up = "?up=".$this_url;
}
/***************** process ***************************************************************************************/
if( isset( $up ) ) {
$up_array = explode( "@", $up );
$up_url = $up_array[0].$post;
if( $up_array[1] != "" ) {
$append = $up_array[1];
$search = "/%20|=/(|)|'/%/";
if( !(preg_match($search, $append) === 1) ){
$up_url = $up_url."#".$append;
}
}
}
else {
$up_url = "./index_j.phtml".$post;
}
/***************** Page ************************************************************************************/
print "
";
?>