PDA

View Full Version : php news help



ducktape
February 3rd, 2003, 11:44
i want to make a news script and the only example i could really find like what i wanna do is

http://www.spoono.com/tutorials/php/counter/

at the bottom there is a table and a form with a list of links which i can do. but if you click on one of the links for help it opens a new page like

http://www.spoono.com/tutorials/php/view.php?id=17

what i want to do is have a privet form so i can insert news into a db (which i can do) then select the info from the db and print a list of links (which I can do) and then when they click a link it opens a new page like ?news.php?id=1 (where im stuck) and the id would be the db table id and then the full news article with title and the person and date it was posted . im not sure how to make pages on the fly like that

spec
February 3rd, 2003, 12:25
very easy.
First you would need to create the link which would look something like this:
$link = 'news.php?id=' . $id;
then you would need something to read it:
if(!empty($_GET['id'])) $id = $_GET['id'];
and then you do your sql query

ducktape
February 3rd, 2003, 13:21
thanks alot ill give it a shot. Im still a newbie but php is rather easy. I wish i knew php was this easy a few years ago. I would have learned then