All pages in the site start with:
<?PHP
session_start();
header("Cache-control: private"); //IE 6 Fix
?>
<HTML>......</HTML>
Here's what's on each individual page:
general.php // Displays all threads with category 'General'
SELECTS all threads from MySQL Database
Stores $title and $username (who created it)
Displays them using echo "<a href=\"showthread.php?title=$title&username=$username\">$title</a>"
showthread.php
SELECTS all of the data (text of thread, text of replies, etc.)
Displays thread and all replies to that thread
Contains REPLY button, which links to reply.php?thread=<?=$threadID?>
** Note, from this point on, $thread contains the value of $threadID
reply.php
SELECTS all of the data (text of thread)
Displays thread to which you are responding
Has a form for Title and Text, stored as 'newtitle' and 'newtext'
Registers the variable $thread which should have been passed from the button on the previous page, right? I register it using:
session_register('thread');
$_SESSION['thread'] = $thread;
But the problem is that this page, reply.php, doesn't seem to have access to the variable $thread. I can't echo it from anywhere on the page.
The only thing that seems to fix it is if I remove the PHP header (included at the top of this post). In that case, everything works fine (the page accesses the $thread variable and displays all content dependent on it). But as soon as i replace that code, it stops. Is there some reason for this? Can I not pass variables normally if I have a session running? If so, is there a way around this? Please help.