Home >Backend Development >PHP Tutorial >请问 input text 怎么传递给 php 的函数

请问 input text 怎么传递给 php 的函数

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 13:16:501084browse

大家好我是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); }?>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn