| | |
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
Views: 663 | Replies: 6
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array autosuggest beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email emptydisplayvalue error explodefunction file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery keywords limit link login loop mail menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search searchbox select server sessions sms soap source space speed sql structure syntax system table tutorial update updates upload url validation validator variable video web xml youtube





