I get some basic results from a mysql database and list it on a page, on the page I've added the links with the variable user_id:
href=\"http://localhost/TESTING/template.php?user_id=$user_id\" >click here
On the template.php file I'll get the $user_id and display the relevant full data.
The thing is I don't want user_id=249 http://localhost/TESTING/template.php?**user_id=**249 to show in the url I'd like something like "http://localhost/TESTING/template.php/249".
I've been looking into this for a few days now with no success, is this possible? Or does the template file need the user_id=$user_id to be displayed in order to get the variable?
=====================
To update: I added the code
RewriteEngine On
RewriteBase /TESTING/
RewriteRule ^template.php/([0-9]+)(/)?$ template.php?user_id=$1 [L]
Changed the link variable to href="localhost/TESTING/template.php/{$user_id}" >click here
The re-write now works, but I'm not getting the variable with $user_id = $_GET["user_id"]; on the template.php page
I added the following to the template.php page to see whats being passed through the url:
<?php
ini_set('display_errors',1);
echo '<b>$_GET Variables</b><pre>';
var_dump( $_GET );
echo '</pre>';
?>
and got the following response:
$_GET Variables
array(1) { ["user_id"]=> string(2) "21" }
How to get the variable?
===========
To update now works! {$user_id} in the link not {user_id} - could of swore i tried both ways.