tfenrich Posted February 17, 2008 Share Posted February 17, 2008 Alright, Heres the deal, I have basically been searching for the code to use php to use the code like = index.php?pagename, how do i do this, I can't for the life of me figure it out, can you help? Quote Link to comment Share on other sites More sharing options...
Chris92 Posted February 17, 2008 Share Posted February 17, 2008 There are several ways of doing this, the simplest would be to use the $_GET method: Eg. index.php?q=Hello%20World <?php echo $_GET['q']; //Will return Hello World ?> You can also do it by simple setting the query string into an array: Eg, index.php?Hello,World <?php $array = explode(",", $_SERVER['QUERY_STRING']); $string = implode(" ", $array); echo $string; ?> Quote Link to comment 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.