doudao7113 2015-12-08 20:05
浏览 18
已采纳

通过键入的表单信息创建新页面[关闭]

I am having some issues with generating a new page on my server when the user has filled out some information via textfields. I want it to save the information in a html file on my server, with the name of the html being taken from the title box. Is there any way I can copy the whole div onto a new page so that it stores it? I'm a complete newbie on this area, but hopefully someone has the time to help.

This is how my html looks:

<div class="form-style-10">
<h1>Create a new guide for others to view<span>Be specific and precise when creating your guide</span></h1>
<form>
<div class="section"><span>✔</span>Give your guide a name</div>
<div class="inner-wrap">
    <label>Please start with "How do" or "How to" <input type="text" name="title" /></label>
</div>
<div class="section"><span>✔</span>Step 1</div>
<div class="inner-wrap">
    <label><input type="text" name="field1" /></label>
</div>
<div class="section"><span>✔</span>Step 2</div>
    <div class="inner-wrap">
    <label><input type="text" name="field2" /></label>
</div>
 <div class="section"><span>✔</span>Step 3</div>
    <div class="inner-wrap">
    <label><input type="text" name="field3" /></label>
</div>   
 <div class="section"><span>✔</span>Step 4</div>
    <div class="inner-wrap">
    <label><input type="text" name="field4" /></label>
</div>   
<div class="section"><span>✔</span>Step 5</div>
    <div class="inner-wrap">
    <label><input type="text" name="field5" /></label>
</div>
<div class="button-section">
 <input type="submit" name="Sign Up" />
 <span class="privacy-policy">
 <input type="checkbox" name="field6">You agree to our Terms and Policy. 
 </span>
</div>
  • 写回答

1条回答 默认 最新

  • duanaixuan7385 2015-12-08 20:37
    关注

    Try making a form using PHP. Here is a great tutorial: http://www.w3schools.com/php/php_forms.asp, make a new file using

    $newfile = fopen("example.html", "w")or die("Couldn't open file.");

    and write into it using

    fwrite($newfile, "Hello world!");

    By the way, don't forget to close the file using

    fclose($newfile);
    

    Hope I helped ;)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 win10权限管理,限制普通用户使用删除功能
  • ¥15 minnio内存占用过大,内存没被回收(Windows环境)
  • ¥65 抖音咸鱼付款链接转码支付宝
  • ¥15 ubuntu22.04上安装ursim-3.15.8.106339遇到的问题
  • ¥15 求螺旋焊缝的图像处理
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面