Jump to content

how to make a link using php?


Kynace

Recommended Posts

I saw a lot of this type of url out on the internet:"..../index.php?NAME=NAME"I was trying to find any written documents about this, but I haven't found any supportive tutorial. Unlike html codes, I can just look at the index of any HTML books and look up the word "link," then I'll find a bunch of tutorial or example supporting it such as this code ....<a href="page.html">name</a>where can I find a tutorial or explanation written about the creating PHP link such as the example on the top?

Link to comment
Share on other sites

You'll just do an echo with the html code in it.echo "<a href='blah'>blah</a>";If you want to add variables to the url add a ?blah=blah to the url. If you want to add more, after the first ? add a & between them. so it'd be ?blah=blah&blah2=blahTo retreive the variables, you'd use $_GET['blah'] or $_GET['blah2'].

Link to comment
Share on other sites

OK....You should study php a little more (if you are brave go to http://php.net )...It's not your fault you don't know... the tutorials here don't seem to talk about it... atleast not in regards to phpthe address might show

http://w3schools.invisionzone.com/index.php?showforum=35

The actual file is located at http://w3schools.invisionzone.com/index.phpThe "?" lets us know that everything after that is information begin sent to that page. The info is given in name=value pairs. So in this case "showForum" is equal to "35". This "info" most often called a query string.So this index.php page might have code inside like this

$showForum = $_GET['showForum'];

This is a way to pass information to web pages so they can use it. In this case instead of writing hundreds of pages, one amazing index.php file is written to take info like what forum to show and it does the work dynamically...That is half the beauty of php and other server-side scripting! That is why you see it in so many address! Especially forums like this!!!!!Some more about this idea of passing info to pages can be found here -> http://www.w3schools.com/php/php_forms.aspHope this helped a bit...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...