I'm developing a website in php and this is my first site using php and I'm new to php.
The site contains 2 pages, index.php and info.php
The index.php has the below form,
<form action="info.php" method="get">
<input type="text" name="username" />
<input type="text" name="company" />
<input type="email" name="email" />
<button type="submit">Click to Proceed!</button>
</form>
When the user enter and submit the details. It redirects to the next page and the url contains the query string like,
http://localhost/info?username=john&company=zend&email=beast@example.com
I want to display the above url like this,
http://localhost/info/john/zend/beast@example.com
and to get the values from url using $_GET['username'],$_GET['company'] and $_GET['email']
I tried the lot of rewrite rule including the below in htaccess,
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteRule ^([\d\w-]+)$ info?username=$1&company=$2&email=$3 [L,QSA]
RewriteRule ^([\d\w-]+)$ info?username=$1&company=$2&email=$3 [QSA]
RewriteRule ^(.*)$ info?username=$1&company=$2&email=$3 [L,QSA]
RewriteRule ^([a-zA-Z0-9-/]+)/([0-9]+)$ info?username=$1&company=$2&email=$3 [L,QSA]
RewriteRule ^([a-zA-Z0-9-/]+)/([0-9]+)$ info?username=$1&company=$2&email=$3 [QSA]
but nothing works.
I tried this and Clean URLs for search query? too.
would somebody help me with this issue.