\n";
echo "The following username/MAC address entries will be registered.
\n";
echo "Please look over the data to verify. If anything is incorrect,
\n";
echo "go back and try again.
\n";
echo "Subnet = $subnet
\n";
echo "Platform = $platform
\n";
echo "Entries to register:
\n";
// Split each line of the incoming data and store in an array. Should be
// "username,macaddr" on each line.
$i = 0;
$lines = array();
$line = strtok($data, " \n");
while ($line !== false) {
$lines[$i] = $line;
$i = $i + 1;
$line = strtok(" \n");
}
foreach ($lines as $index => $line) {
$username = strtok($line, ",");
$macaddr = strtok(",");
echo "$username $macaddr
\n";
$mac1 = strtok($macaddr, ":");
$mac2 = strtok(":");
$mac3 = strtok(":");
$mac4 = strtok(":");
$mac5 = strtok(":");
$mac6 = strtok(":");
$writedata .= $urlprefix . "&uid=$username&mac1=$mac1&mac2=$mac2&mac3=$mac3&mac4=$mac4&mac5=$mac5&mac6=" . trim($mac6) . "&platform=$platform&unrip=$subnet" . "^";
}
echo "
\n";
echo "If everything looks OK, press the Continue button below.\n";
echo "