大家好我是php新手,会一点html和vb.net。最近在学习php,请大家帮忙指点下
<html><body><div align="center"><input id="url" name="url" type=text></div></body></html><?php $url = ' 这里需要接收input text提交的网址 '; $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); }?>
<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怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号