| | |
PHP extension querie! .php?id=2
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Nov 2008
Posts: 1
Reputation:
Solved Threads: 0
Hi all I am a beginner with mark up and am trying my hand at HTML, Javascript and PHP. Currently I am copying source code from sites so I can learn and understand the code and rebuild the sites with my own content.
Just recently I came across a site and within the mark up of the page 'works.php' it gives me this href
which tells the page to go get the URL
http://www.leandroerlich.com/works.php?id=2
what I'm finding hard to grasp is the extension onto the usual .php convention
works.php?id=2
what is "?id=2" ??
I understand that this maybe also a javascript question so I apologise if I am writing this thread in the wrong place.
If anyone can help me I would be very greatful
blunt
Just recently I came across a site and within the mark up of the page 'works.php' it gives me this href
PHP Syntax (Toggle Plain Text)
<li><a href="javascript:getWork(1)">Works 1</a></li>
which tells the page to go get the URL
http://www.leandroerlich.com/works.php?id=2
what I'm finding hard to grasp is the extension onto the usual .php convention
works.php?id=2
what is "?id=2" ??
I understand that this maybe also a javascript question so I apologise if I am writing this thread in the wrong place.
If anyone can help me I would be very greatful
blunt
Last edited by peter_budo; Nov 24th, 2008 at 6:33 pm. Reason: Code tags in wrong place
•
•
•
•
PHP Syntax (Toggle Plain Text)
Hi all I am a beginner with mark up and am trying my hand at HTML, Javascript and PHP. Currently I am copying source code from sites so I can learn and understand the code and rebuild the sites with my own content. Just recently I came across a site and within the mark up of the page 'works.php' it gives me this href <li><a href="javascript:getWork(1)">Works 1</a></li> which tells the page to go get the URL http://www.leandroerlich.com/works.php?id=2 what I'm finding hard to grasp is the extension onto the usual .php convention works.php?id=2 what is "?id=2" ?? I understand that this maybe also a javascript question so I apologise if I am writing this thread in the wrong place. If anyone can help me I would be very greatful blunt
Also, if you really want to learn programming, go to http://www.w3schools.com/
" Of all the things I've lost,
I miss my mind the most...."
Mark Twain
I miss my mind the most...."
Mark Twain
•
•
Join Date: Dec 2007
Posts: 252
Reputation:
Solved Threads: 27
this is how you pass info from one page to another. lets say thats an id of some item from the other page. like a book for a library page. when you click the image or link it will have something like
this carries the book id to the next page. from the next page you can pull that id from the url.
now you can pull data from the db using the $id.
that is why urls have the ?id=2
html Syntax (Toggle Plain Text)
<a href="info.php?id=2> link</a>
this carries the book id to the next page. from the next page you can pull that id from the url.
php Syntax (Toggle Plain Text)
$id = $_GET['id'];
php Syntax (Toggle Plain Text)
$bookinfo = mysql_query('select * from books where bookid = .$id.') or die(mysql_error());
that is why urls have the ?id=2
http://www.leandroerlich.com/works.php?id=2
hi
the id=2 in the above link is a page id,for id=3 its goes to another page
so indicates its a page id
hi
the id=2 in the above link is a page id,for id=3 its goes to another page
so indicates its a page id
•
•
Join Date: Oct 2008
Posts: 8
Reputation:
Solved Threads: 0
•
•
•
•
Hi all I am a beginner with mark up and am trying my hand at HTML, Javascript and PHP. Currently I am copying source code from sites so I can learn and understand the code and rebuild the sites with my own content.
Just recently I came across a site and within the mark up of the page 'works.php' it gives me this href
PHP Syntax (Toggle Plain Text)
<li><a href="javascript:getWork(1)">Works 1</a></li>
which tells the page to go get the URL
http://www.leandroerlich.com/works.php?id=2
what I'm finding hard to grasp is the extension onto the usual .php convention
works.php?id=2
what is "?id=2" ??
I understand that this maybe also a javascript question so I apologise if I am writing this thread in the wrong place.
If anyone can help me I would be very greatful
blunt
![]() |
Similar Threads
Other Threads in the PHP Forum
- Previous Thread: how to connect to remote server usin ssh
- Next Thread: Resource ID issue
| Thread Tools | Search this Thread |
apache api array beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions global google href htaccess html image include insert ip javascript joomla limit link list login mail mediawiki menu mlm msqli_multi_query multiple mycodeisbad mysql navigation number oop parameter paypal pdf php phpincludeissue problem query radio random recourse recursion regex remote script search seo server sessions sms source sp space speed sql static subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web webdesign white xml youtube





