Before I go ahead and ask you my question, I understand that there are many methods on the internet to accomplish this sort of thing. I understand also that this process is called rewriting urls. However, since I am not a proffesional at coding, the process of these things seem very daunting and hard to understand. So, I thought I'd ask the StackOverflow community for help!
Here's what I'd like. Currently, I have 2 main files.
index.php
andphp.php
.
My site allows users to enter a username and get information for that username. index.php
holds the form input, and php.php
handles the actual PHP Code. Once a user has submitted the username, the URL at the end will look like this;
What I'd like the URL above to look like is:
Could somebody here please guide me and explain in an easy manner to understand, how I would go about doing this? Preferably using PHP! Thanks a lot!
The easiest and cleanest way is with .htaccess files, but if you don't want to, you can use PHP, what I'm not sure but this would help URL rewriting with PHP
Well it would be much easier to do this with a .htaccess file: