hey all,
please bare with my as im a complete idiot...
what I have...
I have a flat file system which is much like a guestbook so im going to call it that.
I have a form that when submited adds the entry into an array within a file (DisplayEntries.php).
With each entry, 3 files are created with make up a 'mini' guestbook so other people can comment on other peoples entries. This comment part is included below the entry when a user clicks on a 'comments' link in the entry.
I have a main page file (index.php) which displays the latest 5 entries unless a form on the form is submited which lets the user choose which entries theyd like to display e.g. entries from 5 to 7.
my problem...
The problem im having is, when the 'display entries from # to #' is submited with say from 7 to 8 (displaying one entry) and the comment link is clicked on this entry, the main page will go back to displaying the latest 5 entries insted of staying with only the one entry and displaying the comments guestbook beneath it.
code from main page
<?php
if ($_GET["link"] == "upload") {
include ("upload.php");
include ("notice.php");
}
else {
// Base number for array
$EntryNumber = '0';
// Include array
include ("DisplayEntries.php");
}
// IF form is submitted run PHP script
if ($_POST["GetForm"] == "yes") {
$entryFrom = $_POST['FormFrom'];
$entryTo = $_POST['FormTo'];
}
else {
// Set Entry Number Variables
$entryFrom = 0;
$entryTo = 5;
}
// Display Arrays (entries)
for( $entry = $entryFrom; $entry <$entryTo; $entry++ ) {
eval($EntryArray[$entry]);
}
?>
snipet from entry array (only displaying the comments link and if function)
<?
$EntryArray = array(
$EntryNumber++ =>'
echo "<a href=\"?comments=ID6thAugust114746#ID6thAugust114746\">comments</a>";
if ($_GET["comments"] == "ID6thAugust114746") {
include ("comments/ID6thAugust114746form.php"); //mini guestbook (comments book)
}
else {}',
);
?>
Im pretty sure im doing something wrong with the if function in the main page but i dont really understand what it is...
any help would be great,
thanks for your time.