View Full Version : Link in PHP
04-16-2012, 04:11 AM
Sometimes I see on some websites, when I click on a link or whatever, the url of the page I get is something like this:
Can I know how they made these links? Is it because when you store these links in database, it becomes like this?
04-16-2012, 04:30 AM
When you pass those parameters on a url, PHP will load them into the $_GET array for you. So for example your code could have something like:
echo "I see you're interested in the ".$_GET['title']." job"
So it's a way of providing parameters to a php page, and can be used for a million different things, of course. There's nothing specifically dependent on a database.
04-16-2012, 04:56 AM
i have not understood your example, but i know you are giving the right answer, can you give me a better understanding example?
04-16-2012, 05:52 AM
when you see a url like this:
what its doing is taking the name john and kinda putting it in an envelope (its called a $_GET variable in programming).
now what happens when the web page loads, the programming on the backend can open the envelope called name to see what data is inside...
This is a way web pages can keep state and pass info from page to page for example.... to remember that your logged in on a forum or whatever.
I hope I explained that well enough
edit: btw the & symbol is actually a seperator so that you can have different envople with data, for example
and so on
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.