<?php $urlhead='http://abc.com/';//网址开头 $footurl='.html';结尾内容 if(!isset($_POST["f")){ echo $url=$headurl.$_POST["f"].$footurl; exit(); };?> <html> <body> <form method="post"> 请输入值: <input type="text" name="f"> <input type="submit" /> </form> </body> </html>