I have been working on the solution and found that I needed to add row before the rsPAGEs so its now
<?php
if(!session_id()) session_start();
$_SESSION['COMMID']=$row_rsPAGES['page_1'];
?>
If you go to web_comicxx.php?ID=6 you can see what I am trying to do. Now that I added that the echo works fine, it is the text directly under the "by Administrator" at the top of the page, however I am not concerned with displaying the text, rather I want to use the COMMID session value to filter the pages by comments in recordset4. So when someone enters a comment in the database the session value is entered into the applicable field, THIS WORKS as far as being entered correctly into the database, now the problem is with the recordset4 which I am trying to filter using the session variable of COMMID so the comment made should only show up on the page it was made on... however it's not working that way, it shows up sometimes on some pages, then not at all, sometimes I have to hit refresh to see anything. Any idea what could be causing this not to work? I am pasting the relevant code.
<?php $_SESSION['PAGEID']=$_GET['ID']; ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$currentPage = $_SERVER["PHP_SELF"];
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO messages (username, subject, message, sender, senderID) VALUES (%s, %s, %s, %s, %s)",
GetSQLValueString($_POST['hiddenField'], "text"),
GetSQLValueString($_POST['subject2'], "text"),
GetSQLValueString($_POST['message2'], "text"),
GetSQLValueString($_POST['SENDER'], "text"),
GetSQLValueString($_POST['SENDERID'], "text"));
mysql_select_db($database_con2com, $con2com);
$Result1 = mysql_query($insertSQL, $con2com) or die(mysql_error());
$insertGoTo = "../messagesent.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}