Skip to content Skip to sidebar Skip to footer

How Do I Create A New Webpage From A User Submitted Database Entry?

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 t

Solution 1:

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

Solution 2:

If i understand correctly you can do it with mod_rewrite so you can hide your name parameter, for example:

http://example.com/result.php?name=user-given name

maps to

http://example.com/user-given-name.php

Solution 3:

If the others are right about what you want, this should do what you need:

.htaccess file:

RewriteEngine on
RewriteRule ^([a-zA-Z0-9]+)\.php$ nameLookup.php?name=$1

This will rewrite all URLs like this myname.php, SomeName.php, name3.php to URLs like nameLookup.php?name=myname, nameLookup.php?name=SomeName amd nameLookup.php?name=name3

You will need mod_rewrite enabled on your apache server. You can test this by creating a PHP file with this inside:

<?php phpinfo(); ?>

Check to see if the mod_rewrite module is enabled.

Post a Comment for "How Do I Create A New Webpage From A User Submitted Database Entry?"