SunQuest
 
           PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old January 31st, 2003, 11:19 AM
arthaus arthaus is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Pasadena, CA
Posts: 11 arthaus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
index.php?id=1 --> Q: How is this done?

Hi,

I'm new PHP code. And I've seen pages with following address -- ...index.php?id=1.

Q: How is this done?
Q: Are they using ISSET method? ...defining a variable with include file?

For example, this web site utilizes this method.

I would like a link in my index.php file, once clicked, to display additional content using the id=1 method...

Thankx in advance,
Arthur

Reply With Quote
  #2  
Old January 31st, 2003, 04:00 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
something like that is usually generated from a database

PHP Code:
 $strQuery mysql_query("select * from table");

while(
$row mysql_fetch_array($strQuery))
{

echo 
"<a href='page.php?id={$row['id']}'>Link</a><br>";




That would print a list of links, each with there own unique ids

then to retrive that value, you would use the following code on page.php

PHP Code:
echo $_GET['id']; 


or you could use that id as a index to query the database and get the selected information

PHP Code:
 $strQuery mysql_query("select * from table where id = '{$_GET['id']}'"); 

Reply With Quote
  #3  
Old February 3rd, 2003, 06:09 AM
wAr-AnGeL wAr-AnGeL is offline
Forum Security
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Behind You
Posts: 479 wAr-AnGeL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m
Reputation Power: 7
Send a message via ICQ to wAr-AnGeL Send a message via AIM to wAr-AnGeL
it is possible that it is not being fetched from a db. example: index.php?id=about could be including the /content/about.php file into the template (if they are using a system of some sort)
__________________




"Only Linux users see the end of crashes."
- Pl4t0

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > index.php?id=1 --> Q: How is this done?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway