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. Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.