Author Topic: PHP player script  (Read 1087 times)

Lifaeen

  • Wayfarer
  • *
  • Posts: 4
    • View Profile
PHP player script
« on: June 12, 2009, 03:32:41 pm »
( hope this is the right place  ;D )

this is a little html/PHP script I've written....just in case you have any use for it  :)

Part1 (search.html)

<html>
<head>
<title>search for player</title>
</head>
<body>
<form name="players" action="find.php" method="post">
<font face=arial size=3>

name: <input name="name" type="text" size="8" maxsize="8" value="">

<input type="submit" name="search" value="Search">

</font>
</form>
</body>

Part2 (find.PHP)

<?php
$search = $_POST["name"];
$searchl = " ";
$searchl .= $search;
$searchl .= ",";
$s = 1;
if($search == "")
{
echo "Why don't you go back and enter a name?";
}
else
{
$f1=fopen("http://laanx.fragnetics.com/index.php?page=char_stats","r");
while (!feof($f1)) {
$buffer = fgets($f1, 4096);
$text.=$buffer;
$output[$s] = trim($buffer);
$s = $s + 1;
}
fclose($f1);
$find = eregi ($search, $output[256]);
if($find == "1")
{
echo $search;
echo " is currently online";
}
else
{
echo $search;
echo " is currently offline";
}
}
?>