wright67uk Posted April 14, 2011 Share Posted April 14, 2011 www.mywebpage.co.uk/page22 Is it possible to produce a variable with the value = page22 using only the url above, I know that usually you would use get and post, but I was just curious to know if this had been done before. Link to comment https://forums.phpfreaks.com/topic/233690-passing-a-variable-without-using-get-and-post/ Share on other sites More sharing options...
nethnet Posted April 14, 2011 Share Posted April 14, 2011 Yes, people use methods like this all the time. This is accomplished by using the mod_rewrite Apache directive in conjunction with PHP's GET method. Basically, you tell Apache to interpret URLs differently, so that http://www.example.com/page22 in the browser will actually display http://www.example.com/index.php?param=page22. Here are some useful documents to read to get this working on your server: Apache's mod_rewrite documentation Article from PHPFreak's blog Link to comment https://forums.phpfreaks.com/topic/233690-passing-a-variable-without-using-get-and-post/#findComment-1201468 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.