如何从用户提交的数据库条目创建新的网页? [英] How do I create a new webpage from a user submitted database entry?

查看:122
本文介绍了如何从用户提交的数据库条目创建新的网页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用php和MySQL创建一个字典数据库。用户可以搜索一个名称,如果它存在,它会显示一个匹配链接列表(例如: http:// mydictionary / name.php ),然后用户可以点击该链接并将它们传输到从数据库获取其信息的网页。如果数据库中没有名称条目,则邀请用户进行自己的输入。我可以使用html输入表单,然后将php文件保存到数据库中。

I'm creating a dictionary database using php and MySQL. The user can search for a name, if it's there it brings up a list of matching links (eg: http://mydictionary/name.php) and then the user can click on said link and they are transported to a webpage that get's its information from the database. If there is no entry for the name in the database then the user is invited to make their own entry. I can get this to work using a html input form and then the php file to save it into the database.

我遇到的问题是,当搜索到新输入的名称时,链接将不会激活,因为它会导致不存在的页面。我可以让PHP为我创建新的网址吗?或者是否有人知道解决此问题的方法?

The problem I have is that when this newly entered name is searched for, the link won't be active as it leads to a non-existent page. Can I get php to create the new url for me? Or does anyone know a way around this problem?

非常感谢!

推荐答案

你需要做的是创建一个.htaccess文件和mod_rewrite。

What you need to do is create an .htaccess file and mod_rewrite.

这篇文章将帮助你开始。

This post will help you get started.

http://www.desiquintans.com/cleanurls

这篇关于如何从用户提交的数据库条目创建新的网页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆