PHP School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a PHP Expert!

Join 300,469 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,739 people online right now. Registration is fast and FREE... Join Now!




index.php?page=download ?

 

index.php?page=download ?, help

Vetle

1 Jul, 2008 - 10:55 AM
Post #1

New D.I.C Head
*

Joined: 27 May, 2008
Posts: 23

i can make pages like index.php but not like index.php?page=download

how can i make that work?

User is offlineProfile CardPM
+Quote Post


Martyr2

RE: Index.php?page=download ?

1 Jul, 2008 - 11:02 AM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 7,246



Thanked: 820 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
The ?page=download part is a variable being passed to index.php. You don't create it as a page. What that URL is saying is pass a variable named "page" with the value "download" to the page index.php.

index.php will be able to access that variable using $_GET["page"] which will return the value "download".

Hope that clears things up for you. If you want to know a little more about the $_GET superglobal array I mentioned here you can check out the PHP manual for it at the URL...

PHP.net manual page for $_GET[]

Good luck. smile.gif
User is offlineProfile CardPM
+Quote Post

JBrace1990

RE: Index.php?page=download ?

1 Jul, 2008 - 11:16 AM
Post #3

D.I.C Addict
Group Icon

Joined: 9 Mar, 2008
Posts: 599



Thanked: 45 times
Dream Kudos: 350
My Contributions
as an addition to what the genius Martyr2 said:

GET is effective to use because it allows people to bookmark pages... it also allows people to use text links to go to somewhere instead of submit buttons...

when using these methods though, you're basically coding several pages into one... it's just preference, really... sometimes I try to get as last pages as I can (i made 2 pages for a pokeplushies clone), but other people like to keep them seperated because it makes the actual code on the page smaller, and it's therefore easier to troubleshoot...

but like I said, it's preference and in the real world you'll find pages of both types... one example of using GET is Google... if you go there and search for something, you'll see variable pop into the URL bar, and you can bookmark the page or send it to a friend with the variable still intact...
User is offlineProfile CardPM
+Quote Post

Vetle

RE: Index.php?page=download ?

1 Jul, 2008 - 11:18 AM
Post #4

New D.I.C Head
*

Joined: 27 May, 2008
Posts: 23

thank u so much biggrin.gif
User is offlineProfile CardPM
+Quote Post

JBrace1990

RE: Index.php?page=download ?

1 Jul, 2008 - 11:55 AM
Post #5

D.I.C Addict
Group Icon

Joined: 9 Mar, 2008
Posts: 599



Thanked: 45 times
Dream Kudos: 350
My Contributions
of course... just let us know if you have any other questions about it, and we'll be more then willing to help you =)
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 02:41AM

Live PHP Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month