Home  >  Article  >  Backend Development  >  初学者,关于php生成文件夹的有关问题

初学者,关于php生成文件夹的有关问题

WBOY
WBOYOriginal
2016-06-13 12:44:12706browse

菜鸟求助,关于php生成文件夹的问题,在线等
首先说一下我的需求:在from表单中有4个单选按钮,分别为2011,2012,2013,2014,下面有一个文本框用来建立要生成的文件夹的名字(如a),当用户点击2011按钮时,就进入2011文件夹,并在该文件夹下建立名为a的文件夹,同理选2012则进入2012文件夹中……,我的2011,2012等文件夹都在我所做的项目xuexi下的upload文件夹下,请大牛们指教,先谢谢啦……


------解决方案--------------------
假设你用get方式提交,则
$folder=$_GET['folder']; //单选框的值
$dir=$_GET['dir'];  
mkdir('upload/'.$folder.'/'.$dir);

而创建ajax的代码在网上随便一搜就一大堆了。
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