View Full Version : What is this code for?

03-26-2007, 12:39 AM
Hi! Everyone,

I'm an artist developing my Online portfolio http://bluepen-graphics.com am starting to learn how to convert my html web page to php.

I want to ask info about "?do=newthread&f=6" from "http://www.codingforums.com/newthread.php?do=newthread&f=6"

My question is how this code work "?do=newthread&f=6" what it is for?

Thank you in advance for the info that you can give.

-bluecode (PHP noob)

03-26-2007, 12:51 AM
Those are called get variables and can be accessed using $_GET['name'].

In the example you gave the two get variables would be $_GET['do'] (with the value of newthread) and $_GET['f'] (with a value of 6).

This basically allows you to pass information easily between pages. You can use it in links like in this example:

<a href="test_page.php?action=dosomething">Click me</a>

And can be accessed and used like this:

if($_GET['action'] == "dosomething"){
// do something

You can also use it in headers and form actions (See below):

<form action="blah.php?test=something" method="post">


header("location: test.php?blah=something");

Hope that helps :)

03-26-2007, 01:49 AM
Wow! Thank you so much jmitch18 for enlighten my thinking for this code.

Really helped me... So clear and easy to understand... 2 thumbs up!

Thanks again...

04-01-2007, 11:33 PM
Hi! Jmitch18,

one more question, correct me if am wrong. here's the call link example to a site.


are this link omitted the index.php that supposedly to


Thank you again.


04-02-2007, 12:51 AM
yup you can miss off the index.php if its a root directory

04-02-2007, 07:29 PM
Hi just for reference i made a tutorial for that its free: