Mamadu
Хранитель порядка
- Регистрация
- 20 Ноя 2006
- Сообщения
- 538
- Реакции
- 1.019
- Автор темы
- #1
Прошу подсказки у асов PHP в переделке скрипта...Исходный вариант таков
Пытаюсь переделать чтоб просто цеплял строки из текстового файла и чекал их. Переделал так:
Пахать не хочет.... Может подскажете где косяк?
Код:
<?php
Error_Reporting(E_ALL & ~E_NOTICE);
function menu_ACTION($_GET,$_POST)
{
?>
<html>
<head>
<title>KlikVip Bid checker</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<style>
.frm { font-size: 8pt; font-family: Tahoma; color: #000000; font-weight: bold; border: 1px solid #B5A57F }
.brdr { font-size: 8pt; font-family: Tahoma; color: #000000; border: 1px solid #D9CBAB }
.style1 {
font-size: 8pt;
font-weight: bold;
}
</style>
</head>
<body>
<center>
<table width="200" border="1" bordercolor="#FFFFFF" style="BORDER-COLLAPSE: collapse" cellpadding="1" cellspacing="1">
<tr>
<td align=center><form name="form1" method="post" action="">
<textarea name="your_message" style="width: 600; height: 115;" class=frm></textarea>
<br>
<input type="submit" name="submit" value="Show bids" class=frm style="margin-top:6; margin-bottom:4; width: 70; height: 18; background-color:#D4D0C8">
<input name="action" type="hidden" value="start">
</form></td>
</tr>
<tr>
<td bordercolor="#D9CBAB" border="1"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="brdr">
<tr>
<td bgcolor="#F0EADC" style="padding: 5;"><div class="style1">Show Bids</div></td>
</tr>
<tr>
<td style="padding-top:6;"><table width="100%" border="1" cellpadding="0" cellspacing="0" class="brdr" style="BORDER-COLLAPSE: collapse">
<tr>
<td width="44%"><div align="center"><strong>Title</strong></div></td>
<td width="28%"><div align="center"><strong>Max Bid</strong></div></td>
<td width="28%"><div align="center"><strong>Min Bid</strong></div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</center>
</body>
</html>
<?php
}
if($_GET['action']){$action=$_GET['action'];}
elseif($_POST['action']){$action=$_POST['action'];}
else{$action="menu";}
if(function_exists($action."_ACTION"))
{
call_user_func($action."_ACTION",$_GET,$_POST);
}
//////////////////////////////////
function start_ACTION($_GET,$_POST)
{
?>
<html>
<head>
<title>KlikVip Bid Checker</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<style>
.frm { font-size: 8pt; font-family: Tahoma; color: #000000; font-weight: bold; border: 1px solid #B5A57F }
.brdr { font-size: 8pt; font-family: Tahoma; color: #000000; border: 1px solid #D9CBAB }
.style1 {
font-size: 8pt;
font-weight: bold;
}
</style>
</head>
<body>
<center>
<table width="200" border="1" bordercolor="#FFFFFF" style="BORDER-COLLAPSE: collapse" cellpadding="1" cellspacing="1">
<tr>
<td align=center><form name="form1" method="post" action="">
<textarea name="your_message" style="width: 600; height: 115;" class=frm></textarea>
<br>
<input type="submit" name="submit" value="Show bids" class=frm style="margin-top:6; margin-bottom:4; width: 70; height: 18; background-color:#D4D0C8">
<input name="action" type="hidden" value="start">
</form></td>
</tr>
<tr>
<td bordercolor="#D9CBAB" border="1"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="brdr">
<tr>
<td bgcolor="#F0EADC" style="padding: 5;"><div class="style1">Show Bids</div></td>
</tr>
<tr>
<td style="padding-top:6;"><table width="100%" border="1" cellpadding="0" cellspacing="0" class="brdr" style="BORDER-COLLAPSE: collapse">
<tr>
<td width="44%"><div align="center"><strong>Title</strong></div></td>
<td width="28%"><div align="center"><strong>Max Bid</strong></div></td>
<td width="28%"><div align="center"><strong>Min Bid</strong></div></td>
<tr>
<td width="44%"><div align="center">
<?php
$fp=fopen("out.csv","w+");
fputs($fp,"Keyword".";"."max bid".";"."min bid"."\r\n");
$keyw=$_POST['your_message'];
$zapros=explode("\r\n",$keyw);
include("func.php");
$result=load_pagecook("http://www.klikvip.com/members/");
$cookies=capch_cook($result);
$result=load_pagelog("http://www.klikvip.com/members/",$cookies);
for($i=0;$i<count($zapros);$i++)
{
$result=load_page("http://www.klikvip.com/members/funcs/showbids.php?q=".urlencode(trim($zapros[$i])),$cookies);
$matc=parse_links($result);
echo trim($zapros[$i])."</div></td><td width=\"28%\"><div align=center>",$matc[0],"</div></td><td width=\"28%\"><div align=center>",$matc[count($matc)-1],"</div></td></tr><tr><td width=\"44%\"><div align=center>";flush();
fputs($fp,trim($zapros[$i]).";".$matc[0].";".$matc[count($matc)-1]."\r\n");
}
fclose($fp);
echo " </div> </tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td></tr></table></center><br>";
echo "<center>Çàãðóçèòü ðåçóëüòàò â csv ôîðìàòå: <a href=\"./out.csv\">out.csv</a></center>";
}
?>
Код:
<?php
$ZAP="zap.txt";
function my($ZAP)
{
$fp=fopen("out.csv","w+");
fputs($fp,"Keyword".";"."max bid".";"."min bid"."\r\n");
$keyw=$ZAP['zap.txt'];
$zapros=explode("\r\n",$keyw);
include("func.php");
$result=load_pagecook("http://www.klikvip.com/members/");
$cookies=capch_cook($result);
$result=load_pagelog("http://www.klikvip.com/members/",$cookies);
for($i=0;$i<count($zapros);$i++)
{
$result=load_page("http://www.klikvip.com/members/funcs/showbids.php?q=".urlencode(trim($zapros[$i])),$cookies);
$matc=parse_links($result);
fputs($fp,trim($zapros[$i]).";".$matc[0].";".$matc[count($matc)-1]."\r\n");
}
fclose($fp);
}
?>