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 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?