21,887
社区成员
发帖
与我相关
我的任务
分享
<html>
<body>
<div align="center">
<form name="form1" method="post">
<input id="url" name="url" type=text>
</form>
</div>
</body>
</html>
<?php
$url = isset($_POST['url'])? $_POST['url'] : '';
$ch = curl_init($url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_TIMEOUT,5);
$html = curl_exec($ch);
if($html !== false){
/*echo $html;*/
$fname="vb.htm";
$fd=fopen($fname,"w");
$ok=fwrite($fd,$html);
fclose($fd);
}
?>
<?php
$s = file_get_contents('vb.htm');
preg_match('/txtmod(.+?)subContent/is',$s,$m);
file_put_contents('save.htm',$m[1]);
?>
<?php
$url = isset($_POST['url'])? $_POST['url'] : '';
if($url){
$ch = curl_init($url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_TIMEOUT,5);
$html = curl_exec($ch);
if($html !== false){
$fname=$_POST['putname'] ? $_POST['putname'] : "vb.htm";
$fd=fopen($fname,"w");
$ok=fwrite($fd,$html);
fclose($fd);
}
}
if(isset($_POST['getname'])){
echo 'exe match';
$fname=$_POST['getname'] ? $_POST['getname'] : "vb.htm";
$s = file_get_contents($fname);
preg_match('/txtmod(.+?)subContent/is',$s,$m);
file_put_contents('save.htm',$m[1]);
$filecontent = $m[1];
}else{
$fname = '';
$filecontent = '';
}
?>
<html>
<body>
<div align="center">
<form name="form1" method="post">
<input id="url" name="url" type="text">
<?php if($url==''){ ?>
<input id="putname" name="putname" type="text">
<?php }else{?>
<input id="getname" name="getname" type="text" value="<?php echo $fname;?>">
<?php }?>
<?php if($fname){ ?>
<textarea><?php echo $filecontent; ?></textarea>
<?php } ?>
<input id="submit" name="submit" type="submit">
</form>
</div>
</body>
</html>
<?php
$url = isset($_POST['url'])? $_POST['url'] : '';
if($url){
$ch = curl_init($url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_TIMEOUT,5);
$html = curl_exec($ch);
if($html !== false){
$fname=$_POST['putname'] ? $_POST['putname'] : "vb.htm";
$fd=fopen($fname,"w");
$ok=fwrite($fd,$html);
fclose($fd);
}
}
if(isset($_POST['getname'])){
echo 'exe match';
$fname=$_POST['getname'] ? $_POST['getname'] : "vb.htm";
$s = file_get_contents($fname);
preg_match('/txtmod(.+?)subContent/is',$s,$m);
file_put_contents('save.htm',$m[1]);
}
?>
<html>
<body>
<div align="center">
<form name="form1" method="post">
<input id="url" name="url" type="text">
<?php if($url==''){ ?>
<input id="putname" name="putname" type="text">
<?php }else{?>
<input id="getname" name="getname" type="text" value="<?php echo $fname;?>">
<?php }?>
<input id="submit" name="submit" type="submit">
</form>
</div>
</body>
</html>