Alex Rivera | Logout

What is the "?" symbol in URL used for in php?

Asked 2009-02-22T07:00:33.883
10

I am new to PHP. In the path of learning PHP language, I notice that, some website would this kind of URL:

www.website.com/profile.php?user=roa3&...

My questions:

  1. What is the "?" symbol used for?

  2. If I were develop a php website, must I use it in my URL? For example, after a user(roa3) successful logged in, I will redirect to "www.website.com/profile.php?user=roa3" instead of "www.website.com/profile.php"

  3. What are the advantages and disadvantages of using it?

Edit
Report

1 Answer

2

? is part of the HTTP standard and not part of PHP. Thought I should point that out so when you move on to another language and see it again you are not confused thinking there is PHP involved.

Otherwise there are some excellent answers above.

answered 2009-02-22T10:43:00.493

Your Answer