douxun3496 2014-03-25 18:26
浏览 39
已采纳

如何使用表单创建页面? php / html [关闭]

Similar to how you create a post in wordpress or even ask a question on this very website.

I want to know how to create a page by just filling out a form?

Here's what I know:

-I know how to make an html form

-I know how to place data in a database and take it out

-I know some php

What I don't know is how to to tie all of these things together. Please be as specific as possible and if you know of a tutorial on how to do this or you have the time to make a small example I would be very very grateful.

Thank you in advance for your time :-)

EDIT: To provide more details

I want to send data from a form (even a few text inputs would be enough) and for them to be placed in a page where I can display them.

And also that page should have an unique identifier so it gets stored similar to the questions on stack overflow where there is www.stackoverflow.com/posts/'identifiernumber' And I would always to go back to that information provided I access the link which I assumed will be stored in the database.

  • 写回答

2条回答 默认 最新

  • doucheng1891 2014-03-25 18:32
    关注

    Wordpress uses wysiwyg this is used to convert normal text into html code you can find jquery plugins for it.After user has entered the content of the page and hits submit. Wordpress directly stores the content in the database in HTML FORMAT . Now all it does is echo out the content stored in the database.

    Now for the identifier , it should point out to the primary key of the database row where the content is stored. Wordpress stores a unique url as the identifier like the questions you asked is How to create a page using a form? php/html it will store it as how-to-create-a-page-using-a-form-php-html . This is then put in the href attribute of <a> tag , on click of this unique identifier it echo out the content of that row.

    All you have to do now is make a form and textarea , apply the wysiwyg plugin on the textarea . Then onsubmit store the data in the database and also creating a unique identifier for it.

    You question now is how to pass the identifier in the URL?

    First you must know how to pass a variable in the URL and then capture it in the required place eg : www.yourwebsite.com?identifier=something and to make this a link on you website

    <a href="www.yourwebsite.com?identifier=something">Something</a>
    

    Once you have mastered this you can then study a concept called MOD REWRITE and in layman term for this is called clean URL or SEO URL . There are many blogs and methods of achieving this goal. You can google MOD REWRITE and SEO URL.

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

报告相同问题?

悬赏问题

  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3