Go Back   Cloud Computing > Support > PHP Forum
 

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 09-29-11, 21:47
BOD Member
 
Join Date: Aug 2011
Posts: 76
Default Passing Variables thru URLs

Ok, heres the deal. Im creating a MySQL / PHP driven content manager to display my web templates and my portfolio dynamically so I dont have to make 5 dozen HTML pages.

What I need help with is this... I want to pass a unique template ID thru a url and on the next page, and on the next page, I want to use the ID to get the template information out of my database. I want to do this so I have one page named display_details.php that will display the info dynamically instead of creating a .html page for each template.

If you could help me out, Id greatly appreciate it.

Thanks
Reply With Quote
  #2 (permalink)  
Old 10-03-11, 09:18
BOD Member
 
Join Date: Jul 2011
Posts: 68
Default

Your link will be like so

display_details.php?id=3

then when they click on that it will load it and you have this getting the info from the database.

select * from table where id = '{$_GET['id']}'

which in turn will be this

select * from table where id = '3'

and then you load everything that is in the table with an id of 3. Its simple...
Reply With Quote
  #3 (permalink)  
Old 12-02-11, 11:17
BOD Member
 
Join Date: Dec 2011
Posts: 16
Default passing variable in url

hi,
This is so simple please see the example below
http://xyz.com/abc.php?id=4&value=yes

The above url passes two values named id and value in the url. and these value can be get using $_GET method of php.

Thanks
CoreIT Developers
Reply With Quote
Reply


Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT -6. The time now is 01:19.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 1999-2012, BODHost Ltd. All rights reserved.