热搜:NVER node 开发 php

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

2024-07-24 23:05:01
请问 input text 怎么传递给 php 的函数

大家好我是PHP新手,会一点HTML和VB.NET。最近在学习PHP,请大家帮忙指点下

<?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); }?>


回复讨论(解决方案)

<?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); }?>