| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| Php site.com?site | |
|---|---|
| Tweet Topic Started: May 5 2005, 10:24 PM (1,084 Views) | |
| Das | May 5 2005, 10:24 PM Post #1 |
![]()
Smells of rich mahogany
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
This is probably pretty noobish, but how do you get http://www.url.com/index.php?something ? I don't get the .php?something is that like a mask of a new page, or is that some Sql thing? |
![]() |
|
| Seth | May 5 2005, 11:24 PM Post #2 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
It's found in the $_GET[] superglobal array. http://sethkinast.com/blog/?q=200 gives me $_GET['q'] == 200, which IdioQuote then steals and grabs Quote #200 from the database. |
![]() |
|
| Das | May 5 2005, 11:32 PM Post #3 |
![]()
Smells of rich mahogany
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
You get a round of applause. You managed to make me think I understood, then make me confunsed, then make me hit my head aginst the wall, then make me make me ask why I can't understand, and finally you mad me ask what the mullet $_get[] is. Not only did you make me do all that you made me do it in about a 35 second time span. ![]() Can you expain what $_get[] is, and how it is used? And if you can don't link to php.net that is sometimes confusing. |
![]() |
|
| Seth | May 5 2005, 11:59 PM Post #4 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
$_GET[] is an array. It contains all the variables in the URL like ?q=200. |
![]() |
|
| Das | May 6 2005, 12:01 AM Post #5 |
![]()
Smells of rich mahogany
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
How is it used in PHP? Does it actually create a new subpage? Can you give a coded example? |
![]() |
|
| Seth | May 6 2005, 12:20 AM Post #6 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
http://sethkinast.com/blog/?q=33 ======= $qid = $_GET['q']; $quote = get_quote($qid); echo($quote); // echoes Quote #33 |
![]() |
|
| Das | May 6 2005, 12:42 AM Post #7 |
![]()
Smells of rich mahogany
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I guess knowing what quotes were might help hint hint. Is $_Get[] kinnda like taking bob.php and turning it in to index.php?bob ? |
![]() |
|
| Seth | May 6 2005, 12:43 AM Post #8 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Nooooooooooooooooooooooooooooooooooooooooooo. It's NOT some sort of way to make new pages. It's just a variable. I set it to 33. *thinks* The quotes are the Quote of the Moment on my blog. |
![]() |
|
| Das | May 6 2005, 12:47 AM Post #9 |
![]()
Smells of rich mahogany
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I r teh dummy. Lets see if I can make things simple. How does ?showtopic=137803&st=0entry3123828 show this page? Is this topic it's own file? If I am getting on your o so wise nerves a link would work. |
![]() |
|
| Seth | May 6 2005, 01:15 AM Post #10 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
That creates the variable $_GET['showtopic'] == 137803. IPB then says, get the topic with ID 137803 from the database. Plug it into the templates. |
![]() |
|
| kingy | May 6 2005, 02:26 AM Post #11 |
|
1 in 10 people understands binary, the other 1 doesn't
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Simple example for you www.page.com/index.php?who=Kingy
That would make it say Name says hello You could change the name to anything and it would still work Its a way of setting a variable into a value. |
![]() |
|
| Gornakle | May 6 2005, 04:23 AM Post #12 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Basically, it lets the user set a few variables. For instance:
That would always display the topic with ID 20. That's no good, because now you could only view one topic. So, you let the user chose the topic ID:
Now, file.php?id=21 would set $topic_id to 21 and we'd get the topic we'd want. Yay.
|
![]() |
|
| Dennis | May 6 2005, 08:38 AM Post #13 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
GET natively is a method of passing form information from one page to another. Using a GET kind of tricks PHP into thinking that you filled out a form, and it uses that to decide what to put on the page. Like this: URL: index.php?act=home
The home page would be active now, since the "act" variable is set to home. |
![]() |
|
| Rory | May 6 2005, 08:42 AM Post #14 |
|
i;m a mess
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
you have your $_GET['act'] = $act; the wrong way round. It should be: $act = $_GET['act']; |
![]() |
|
| Dennis | May 6 2005, 08:43 AM Post #15 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Oops. Sorry. It's fixed now. |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| Go to Next Page | |
| « Previous Topic · Technology Chat · Next Topic » |
| Track Topic · E-mail Topic |
8:35 AM Jul 11
|




![]](../../../../0/1/0/p601690/pipright.png)




8:35 AM Jul 11