Re: Connected Socket
| From: | Chris Mach | Date: | Thu, 01 May 2003 14:58:48 +0000 |
| Subject: | Re: Connected Socket | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-27472@lists.php.net to get a copy of this message | ||
Sorry i should have posted my code to begin with...
<html>
<?php
$filename = "http://snipergods.port5.com/db1.txt";
$filepointer = fopen($filename, "r");
$arrayFormFile = file($filename);
fclose($filepointer);
// For as long as $i is <= the size of the $line array,
// explode each array element into a username and password pair
$i = 0;
$auth = 0;
$data_pair = explode(",", $arrayFormFile[$i]);
while($i < sizeof($data_pair))
{
if (($data_pair[$i] == $UserName) and ($data_pair[$i+1] ==
$Password))
{
$auth = 1;
}
$i++;
$i++;
}
if ($auth == "1")
{
print "<h1>Welcome $UserName</h1>";
echo "<p>You're authorized!</p>";
exit;
}
else
{
print("wrong id or password");
exit;
}
?>
</html>
"Peter Lovatt" <pjln1@sunmaia.net> wrote in message
news:NFBBKAGAILLHPFOOAKFIOEDLFPAA.pjln1@sunmaia.net...
> Hi
>
> a guess.....
>
> are you using
> $filehandle = fopen ("filename", "r");
>
> to open the file
>
> http://www.php.net/manual/en/function.fopen.php
>
> for more......
>
> if not, that may be the reason, otherwise post the code you are using and
> lets go from there
>
> Peter
>
> -----Original Message-----
> From: Chris Mach [mailto:cjmach@learn.senecac.on.ca]
> Sent: 01 May 2003 05:44
> To: php-db@lists.php.net
> Subject: [PHP-DB] Connected Socket
>
>
> I'm trying to open a simple text file with php and i'm getting a warning
> that says...
> A socket must be already connected...
>
> Does any one know why i'm getting this? or how to fix it?
>
> Thanks :o)
>
> - Chris
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>