首页 > 其他 > 详细

跑数据示例一

时间:2016-02-18 10:07:59      阅读:235      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!