PHP5 的代码升级到 PHP7 遇到的问题

2016-07-15 16:46:04 +08:00
 Smirnoff

准备把 PHP5 的代码升级带 PHP7 ,其他的代码基本修改完成,但是下面这段代码数组存取就是不显示内容, 大家帮忙看看指出错误谢谢。。。

           <?php 
			$echo=1;
			$search="";
			if(isset($_POST['search'])){$search="and url like '%{$_POST['search']}%'";
			}
			$query=mysqli_query($conn,"select count(*) as row from sqlmap where hash!='' {$search} and userhash='{$hash}' order by pr desc");
			while($row=mysqli_fetch_array($query)){
			if($row['status']=='running') {$class='active';}
			else{$class='success';}
			preg_match_all('/ => \'(.*)\n\'/',$row['data'],$match);
			$match=$match[1];
			$last=@$match[count($match)-1];
			$key=$row['key'];
			$stat=$row['status'];
			$url=$row['url'];
			$pr=$row['pr'];
			$dbtype=$row['dbtype'];
            $node=$row['apiserver'];
			if(stripos($last,"back-end") and stripos($last,"--dbms")==false){
				$class='danger';
				$stat='Inject';
				mysqli_query($conn,"update sqlmap set status='{$stat}' where `key`='{$key}' and userhash='{$hash}'");
				
			}
			preg_match_all('/ => \'(.*)\n\'/',$row['data'],$match);
			$data='';
			foreach($match[1] as $m){
						$m=stripcslashes($m);
						$data.=$m."\n";
					
						
					}
				
			if(@$_GET['vul']==1 and $stat!='Inject'){
				//echo $stat."<br>";
				$echo=0;
			}else{$echo=1;}
			if($echo){
			?>
		
				<tr class="<?php echo $class?>">

					<td>
						<?php echo $key?>
						<?php echo test?>
						<?php echo $row?>
						<?php print_r ($key);?>
					</td>
					<td>
						<?php echo substr($url,0,60)?>..
					</td>
					<td>
					
						<?php echo $stat;?>
						
					</td>
                        <td>
					
						<?php echo $node;?>
						
					</td>
9743 次点击
所在节点    PHP
44 条回复
aristotll
2016-07-16 15:33:30 +08:00
最好语言躺枪...
summersky92
2016-07-16 22:57:03 +08:00
这个。。。 xdebug 一行行走也能找到了吧。。。。
ychongsaytc
2016-07-17 04:37:53 +08:00
久未见惨状,忽然感觉有点亲切
Aaron99
2016-07-17 12:25:18 +08:00
@initialdp 他用的 mysqli

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/292731

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX