dqv2743 2012-12-29 12:09
浏览 42
已采纳

PHP自动生成新页面

I'm making a social network type site, where users can upload their items to be rated. However, I'm trying to improve the way the site is laid out, so want to automatically generate pages once the user inserts a new item. The add.php page has the following form:

<form action="add.php"  method="post"  autocomplete="on" enctype="multipart/form-data" action="<?php echo                  $_SERVER['PHP_SELF']; ?>" method="POST" id="pic">
    <p> <label for="jname" class="iconic user"> Name of Jam <span class="required">*</span></label> <input type="text" name="jname" id="jname" value="<?php if (isset($_POST['jname'])) echo $_POST['jname']; ?>" required="required" placeholder="Input your Name of Jam here"  /> </p>

    <p> <select name="jtype" id="jtype" value="<?php if (isset($_POST['jtype'])) echo $_POST['jtype']; ?>" required="required">
            <option value="jam">Jam</option>
            <option value="jelly">Jelly</option>
            <option value="marmalade">Marmalade</option>
            <option value="preserve">Preserve</option>
        </select> </p>

    <p> <label for="producer" class="iconic user"> Jam Producer <span class="required">*</span></label>     <input type="text" name="producer" id="producer" value="<?php if (isset($_POST['producer'])) echo $_POST['producer']; ?>" required="required" placeholder="Input the producer of the Jam here"  /> </p>
    Upload a picture of your jam: </br> </br> <input name="userfile" type="file" /> </br>
    <input type="submit" name="submit" value="Register" />    
    <input type="hidden" name="submitted" value="TRUE" />

</form>

When the form is submitted, I then want it to generate a new page for that new user created item. Is there a fairly simple way of doing this?

Cheers

  • 写回答

4条回答 默认 最新

  • doudou6719 2012-12-29 12:21
    关注

    You don't have to actually 'create' new html page for each item.

    You could save this information to database (mysql for example).

    Then you could create another php file, say 'item.php' and access different entries from mysql database like so:

    item.php?id=1

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 ogg dd trandata 报错
  • ¥15 高缺失率数据如何选择填充方式
  • ¥50 potsgresql15备份问题
  • ¥15 Mac系统vs code使用phpstudy如何配置debug来调试php
  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错