码迷,mamicode.com
首页 > 其他好文 > 详细

跑数据示例一

时间:2016-02-18 10:09:43      阅读:128      评论:0      收藏:0      [点我收藏+]

标签:

<?php 
$id = isset($_GET[‘id‘]) ? intval($_GET[‘id‘]) : 0;
$w = isset($_GET[‘w‘]) ? intval($_GET[‘w‘]) : 0;

$arr = file(‘code-‘.$w.‘.txt‘);

if (!array_key_exists($id,$arr)){
    echo ‘finish protein-‘.$w.‘-F.txt‘;
    $w++;
    header("location:http://127.0.0.1/20150115/a.php?w=".$w);
    exit;
}

$Conn = mysql_connect ( "localhost", "root", "root" ) or die ( "连接服务器失败 !!!" );
mysql_select_db ( "1111" ) or die ( "选择数据库失败 !!!" );


$code = preg_replace(‘/[\r\n]+/‘,‘‘,$arr[$id]);
$sql = "select product_oldid from product where product_pid = 10 and product_code = ‘".$code."‘ 
and product_hidden = 1 and product_deleted = 0 limit 1"; $rs = mysql_query($sql); while($row = mysql_fetch_array($rs)){ $parr[] = $row; } if (!empty($parr)){ $str = "http://www.cusabio.com/protein-Recombinant_Protein-".$parr[0][‘product_oldid‘]."/"; $str .= "\r\n"; } else { $str = "\r\n"; } mysql_close($Conn); file_put_contents(‘enUrl-‘.$w.‘.txt‘,$str,FILE_APPEND); ?> <script> function JumpUrl() { location.href=‘?id=<?php echo ($id+1);?>&w=<?php echo $w;?>‘; } setTimeout(‘JumpUrl()‘,0); </script>

 

跑数据示例一

标签:

原文地址:http://www.cnblogs.com/wuheng1991/p/5197104.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!