当前位置:Gxlcms > PHP教程 > 实践二

实践二

时间:2021-07-01 10:21:17 帮助过:4人阅读

PHP-表单的读写,File文件的操作等---ShinePans

实践一:


表单的操作:


wlcome_page.php

			


welcome_info.php:


	

Welcome!

You are years old.

Your Address is .


Your Phone number is .




menu1.php:

	Home|	About Us|	Contact Us	



表单显示效果,填写信息:




实践二

文件的上传,文件的读取:


open_close_file_test.php:

	";	}	/*	字数判定;	*/	$file1=fopen("test_files1.txt","r");	while(!feof($file1))	{		if(fgetc($file1)!=' ')		$num_of_char++;	}	echo "The test_files1.txt have the number of ".$num_of_char." chars";	?>		


upload_file.php

	0)	{		echo "Error:".$_FILES["files"]["error"]."
"; } else { echo "Upload:".$_FILES["file"]["name"]."
"; echo "Type:".$_FILES["file"]["type"]."
"; echo "Size:".($_FILES["file"]["size"]/1024)."kb
"; echo "Stored in:".$_FILES["file"]["tmp_name"]; } ?>

效果显示:




上传后服务器返回的信息:




至此,表单的信息获取,文件的上传实践至此.


人气教程排行