I have been trying to get pages that the address are: example.com/forum/forum.php?t=3 I have been looking at tutorials and I have found stuff, but I don't quite get how it works and where to put the code that executes to make dynamic URLs. Help or other tutorials would be great. Thanks in advance, W3C
Your forum.php script which is a PHP script should take into consideration the parameter passed (t=3) and should display the results based on the condition specified.
Sorry I put a wrong example. Here is a better one: example.com/index.php?page=browse How would this code look to have an outcome of this address? Would it be just the '<a>' tag with the attibute of 'href="index.php?page=browse"', or how would you get a link to do that?
I am not able to get what you are asking. The parameter name and value will not make much of a difference provided it has been handled in the script. In the second example the script is index.php.
What I want to know is how to get a link like a browse file and when clicked on have the address be: example.com/index.php?page=browse Example: A site has home, browse, community, and contact us links. I want to know when the links are clicked on the address is: browse = example.com/index.php?page=browse community = example.com/index.php?page=community contact us = example.com/index.php?page=contact_us Is there a special code to execute that?
Are you suggesting that you want to include the files according to the parameter that is passed?? If that is what you want to do, that's very much possible to do.
That's is very simple, all you would need to do is to use a switch statement. Here is a sample code, PHP: $page = $_GET['page']; switch($page) { case 'browse': include('browse.php'); break; case 'contact_us': include('contact_us.php'); break; }
Thanks for the code. But what I don't really quite get is where to insert the code and how it works with links.
Insert the code in index.php, the logic is that according to the page parameter's value appropriate file is included and it's contents are executed, which as a result will change the output according to the parameter passed.