<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title></title> <meta charset="UTF-8"> </head> <body> <?php function make_text_input($name,$label){ echo '<p><label>'.$label.':'; echo '<input type="text" name="'.$name.'" size="20"'; if(isset ($_POST['$name'])){ echo 'value="'.htmlspecialchars($_POST[$name]).'"'; } echo ' /></label></p>'; } print '<form action="" method="post">'; make_text_input('first_name','First Name'); make_text_input('last_name','Last Name'); make_text_input('email','Email Address'); print '<input type="submit" name="submit" value="Register!" /></from>'; ?> </body> </html>
php-创建和调用接受参数的函数
猜你喜欢
转载自blog.csdn.net/qjy_985211/article/details/80285876
今日推荐
周排行