This is what splash.php looks like:
<form method="POST" action="$action">
<input type="hidden" name="redirect" value="http://192.168.2.1/splash/check_status.php?requestedPage=$redirect">
<input type="hidden" name="requestedPage" value="$redirect">
<input type="hidden" name="accept_terms" value="yes">
<input type="hidden" name="mode_login">
<input type="submit" class="button" value="Entrar a la Red...">
</form>
The action script is a perl script that is ran by NoCat to allow access to the user. What I do here is that I force that script to check_status.php.
Here's what the check_status.php looks like:
if ( $SERVER["HTTP_CLIENT_IP"] ) $ip = $SERVER["HTTP_CLIENT_IP"];
else if( $SERVER["HTTP_X_FORWARDED_FOR"] ) $ip = $SERVER["HTTP_X_FORWARDED_FOR"];
else if( $SERVER["REMOTE_ADDR"] ) $ip = $SERVER["REMOTE_ADDR"];
else $ip = "UNKNOWN";
$mac = `sudo arp -i eth1 $ip | grep : | awk '{print $3}'`;
//record visit
$query = "insert into network_access ( ip, mac, timevisit ) values ( '$ip', '$mac', " . time() . " )";
$result = dba_connect( $query, 1 ) or
die( "Query: '$query', failed with error message: -- " . mysql_error() . " --" );
// end visit record
// check if is a company address
$query = "select * from private_ip where priv_ip_address='$ip'";
$result = dba_connect( $query, 1 ) or
die( "Query: '$query', failed with error message: -- " . mysql_error() . " --" );
// immediately send private ip's to the requested page
if( mysql_num_rows( $result ) >= 1 ){
$location = "Location: " . $_REQUEST['requestedPage'];
header("$location");
exit;
}
$query = "select dhcp_cust_id as id from dhcp where dhcp_ip='$ip'";
$result = dba_connect( $query, 1 ) or
die( "Query: '$query', failed with error message: -- " . mysql_error() . " --" );
// if there isn't any match here then the user is not registered.
if( mysql_num_rows( $result ) == 0 ){
$location = "Location: ./notregistered_mesg.php";
header("$location");
exit;
}
$row = mysql_fetch_array( $result );
$query = "select customer_status as status from customer where customer_id=" . $row["id"];
$result = dba_connect( $query, 1 ) or
die( "Query: '$query', failed with error message: -- " . mysql_error() . " --" );
$row = mysql_fetch_array( $result );
if( $row["status"] == "SUSPENDIDO" ){
header("Location: ./suspended_message.php");
exit;
}
else
{
$location = "Location: " . $_REQUEST['requestedPage'];
header("$location");
}
==============================
So, what I would like to do is run another script before the header that would check if the user has a pending balance to remind them with a pop up window and still let them continue with their requested page..