Afternoon,
I found this script to get a logon id of a person now I need to set it as a variable so I can put it in the form I've been looking at it but I can't seem to figure it out....
<?php
/
Getting netbios info
CopyLeft 2002 (GNU GPL V2) by polo
/
error_reporting(E_ALL);
/ get the ip of the client /
if (isset($SERVER["HTTP_X_FORWARDED_FOR"]))
{
$ip = $SERVER["HTTP_X_FORWARDED_FOR"];
} else {
$ip = $_SERVER["REMOTE_ADDR"];
}
echo 'ip : '.$ip.'<br>';
/ send a "special" packet /
$fp = fsockopen('udp://'.$ip, 137);
fwrite($fp, "\x80b\0\0\0\1\0\0\0\0\0\0 CKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\0\0!\0\1");
/ wait 2 secs, and get the data /
socket_set_timeout($fp, 2);
$data = fread($fp, 256);
/ get netbios records number /
$nbrec = ord($data[56]);
/ display nebios records : the username is a record of type 3 /
echo '<table border="1">';
echo '<tr>
<th>no</th>
<th>type</th>
<th>value</th>
</tr>';
for($i = 0; $i < $nbrec; $i++) {
$offset = 18 * $i;
printf ("<tr>
<td>%02d</td>
<td>%02X</td>
<td>%s</td>
</tr>",
$i,
ord($data[72 + $offset]),
trim(substr($data, 57 + $offset, 15)));
}
echo '</table>';
?>
Thanks for any help you can provide.
Laura