Hi
I am seeking an alternative to $_get. The below code works by using the $_get, what I want to do is have the while loop run. Then when the user clicks on a story have a session set. As I have said the below code works ... but I would like to set the session and not use the get(this is stop people messing around). I hope my question makes sense. Thanks in advance.
$query = "select id, new_edition from stories order by creation_date";
$result = mysql_query($query);
// display all the urls
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$id = $row['id'];
echo '<a href="archives.php?id='.$id.'">'.$row['new_edition']."</a><br/ >";
}
On the second page
if($_GET['id']) {
$_SESSION['edition'] = $_GET['id'];
echo $_SESSION['edition'];
}
I am seeking an alternative to $_get. The below code works by using the $_get, what I want to do is have the while loop run. Then when the user clicks on a story have a session set. As I have said the below code works ... but I would like to set the session and not use the get(this is stop people messing around). I hope my question makes sense. Thanks in advance.
$query = "select id, new_edition from stories order by creation_date";
$result = mysql_query($query);
// display all the urls
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$id = $row['id'];
echo '<a href="archives.php?id='.$id.'">'.$row['new_edition']."</a><br/ >";
}
On the second page
if($_GET['id']) {
$_SESSION['edition'] = $_GET['id'];
echo $_SESSION['edition'];
}