Hi friends,
I am trying to find a string from a Html file but not succeded.. as file is this ...
<html>
<head>
<title>Merchant Administration Area - Un-Authorized Access</title>
<STYLE type="text/css">
DIV.section { text-align: justify; font-size: 12pt; color: white}
DIV.subsection { text-indent: 2em }
H1 { font-style: italic; color: green }
H2 { color: green }
</STYLE>
</head>
<body bgcolor="#ffffff" alink="#ffffff" link="#ffffff" vlink="#ffffff">
<div align="center">
<table cellspacing="0" cellpadding="4" border="0">
<tr>
<td align="center" colspan="2"><img src="/adminlogos/pnp_admin_logo.gif" alt="Corp. Logo"></td>
</tr>
<tr>
<td align="center" colspan="2"><img src="/images/icons.gif"></td>
</tr>
<tr>
<td align="center" colspan="2"><font size=+1 color="#4a7394">Un-Authorized Access.</font></td>
</tr>
<tr>
<td align="center" colspan="2">
<font size=+2 color="#4a7394"><b>Having problems logging in?</b></font>
<br><font size=+1 color="#4a7394">See our FAQ (Frequently Asked Questions) section for guidance to fix your login issues.</font>
<p><a href=/docs/faq/index.html><font size=+1 color="#4a73FF">FAQ (Frequently Asked Questions)</font></a>
<p>
</td>
</tr>
<tr>
<td align="center" colspan="2">If you have forgotten your password and would like a new one emailed to you, please enter your<br>email address that the account was set up with and username in the spaces provided and click on the "Submit Request" Button.</td>
</tr>
<tr><td><br></td></tr>
<form method="post" action="https://pay1.plugnpay.com/lostpass.cgi">
<tr>
<td align="right" width="40%">Email Address: </th>
<td align="left"><input type="text" name="email" size="30" maxlength="40"></td>
</tr>
<tr>
<td align="right">Username: </th>
<td align="left"><input type="text" name="username" size="30" maxlength="40"></td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="hidden" name="function" value="sendconfirmation">
<p><input type=submit value="Submit Request">
</td>
</tr>
</form>
</table>
<br>
</body>
</html>
and the script is this.....
<?
// open the text file
$fd = fopen ("updat.csv", "r");
// initialize a loop to go through each line of the file
while (!feof ($fd))
{
// declare an array to hold all of the contents of each row, indexed
$buffer = fgetcsv($fd, 4096);
for ($i = 0; $i < 43; $i=$i+44)
{
if ($buffer[$i] == "")
{
$buffer[$i] = " ";
}
$CardName=$buffer[0];
print $CardName."CardName<br>";
$logintext="Having problems logging in?";
$logincheck=strcmp($CardName,$logintext);
print $logincheck. "logincheck<br>";
if ($logincheck ==0)
{
print $logincheck."CardName found<br>";
}
}
}
fclose ($fd);
?>
but the result is very diffrenece as it open the page and also give error like this
CardName
-1logincheck
CardName
-1logincheck
CardName
-1logincheck
CardName
-1logincheck
CardName
-1logincheck
CardName
-1logincheck
Note ::: this script also read a CSV file and update database which script is not include here but problem here when the file become a html file so i need to check for this html file as u see above so i want to compare a string from this file whcih indicate me that this is a html file and i do some differen to update database......
Please give some help...