dialup admin coding - help required

Cory Robson cory at cmi.net.au
Fri Dec 22 04:45:18 CET 2006


Ok I have tried and tried to get this to work how I want but obviously need
more sleep, not being a code genius and trying to learn this mix and mash is
confusing enough.

Anyway this is my code for my failed login page, my sql query does parse all
information into the array ok but I just cannot seem to get it to output on
screen. Any way here is what I have so far anyone able to assist in showing
me where I'm going wrong.



<?php
require('../conf/config.php3');
?>
<html>
<?php

if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php3"))
	include_once("../lib/sql/drivers/$config[sql_type]/functions.php3");
else{
	echo <<<EOM
<title>Failed logins</title>
<link rel="stylesheet" href="style.css">
</head>
<body bgcolor="#80a040" background="images/greenlines1.gif" link="black"
alink="black">
<center>
<b>Could not include SQL library functions. Aborting</b>
</body>
</html>
EOM;
	exit();
}

$now = time();
$start = $now - ($last*60);
$now_str = date($config[sql_full_date_format],$now);
$prev_str = date($config[sql_full_date_format],$start);



?>

<head>
<title>Failed Logins</title>
<link rel="stylesheet" href="style.css">
</head>
<body bgcolor="#80a040" background="images/greenlines1.gif" link="black"
alink="black">
<center>
<table border=0 width=550 cellpadding=0 cellspacing=0>
<tr valign=top>
<td align=center><img src="images/title2.gif"></td>
</tr>
</table>
<table border=0 width=400 cellpadding=0 cellspacing=2>
</table>
<br>
<table border=0 width=840 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=65%></td>
<td bgcolor="black" width=35%>
	<table border=0 width=100% cellpadding=2 cellspacing=0>
	<tr bgcolor="#907030" align=right valign=top><th>
	<font color="white">Failed Logins</font> 
	</th></tr>
	</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
	<table border=0 width=100% cellpadding=12 cellspacing=0
bgcolor="#ffffd0" valign=top>
	<tr><td>
<?php
echo <<<EOM

EOM;
?>

<p>
	<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000
width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
	<tr bgcolor="#d0ddb0">
	<th>#</th><th>login</th><th>Password</th><th>Time</th><th>Terminate
cause</th><th>Caller ID</th>
	</tr>

<?php



$link = @da_sql_pconnect($config);

	$search = @da_sql_query($link,$config,
	"SELECT id, user,pass,reply,date,callingid
	FROM radpostauth
	ORDER BY date;");
	$num = 0;
		
*// Here is where my array collects the records - This is working *//

		while( $row = @da_sql_fetch_array($search,$config) ){    
			
			$num++;
			$acct_login = $row[user];
			$acct_password = $row[pass];
			$acct_terminate_cause = $row[reply];
			$acct_time = $row[date];
			$acct_callingid = $row[callingid];
			
			
	}

?>
			

*// Here is my screen output, obviously I need to loop through the array and
output the lines but just can't figure it out. *//


	<tr align=center bgcolor="white">
				
				<td>$num</td>
				<td>$acct_login</td>
				<td>$acct_password</td>
				<td>$acct_time</td>
				<td>$acct_terminate_cause</td>
				<td>$acct_callingid</td>
			</tr>
	

	

	</table>

</td></tr><tr><td>

</td></tr>
</table></td></tr></form>
</table>
</tr>
</table>
</body>
</html>






More information about the Freeradius-Users mailing list