Page 1 of 1
Creating a series of pages???
Posted: Sat Jul 22, 2006 5:01 pm
by cturner
What I want to know is how does a page such as article.php?id=1 then article.php?id=2 be created? Does it have to created manually or is there some code that creates each page?
Posted: Sat Jul 22, 2006 5:24 pm
by thiscatis
maybe with
Code: Select all
if (isset($_GET['pid'])) {
$id = preg_replace('/[^a-zA-Z0-9\_]/', '', $_GET['pid']);
} else {
$id = '1';
}
and then make your SQL query something like :
Code: Select all
" SELECT * FROM articles WHERE id='$id' "
Posted: Sat Jul 22, 2006 5:25 pm
by Luke
You can use the get method in your form tag
Code: Select all
<form method="get" action="page.pgp"><input type="hidden" name="id" value="1">
Or you can just insert it into a link
Code: Select all
<a href="page.php?id=1>Something</a>
Posted: Sat Jul 22, 2006 5:43 pm
by cturner
Thanks guys for your help. Problem has now been solved.