close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Sessions not clearing and setting properly

Thread began 4/19/2013 6:06 pm by mrs | Last modified 4/22/2013 9:39 am by Jason Byrnes | 352 views | 1 replies |

mrs

Sessions not clearing and setting properly

I'm having trouble with sessions clearing and then being set again.

Basically, I have built a forum where there are a number of different categories, and I have created a breadcrumbs effect for each forum category from he top level down to inserts and replies, but for some reason, on the insert page, it won't give the right forum category name that I'm posting in. So, the bread crumbs for a new post would look like:

Forum <-- Rallies shows & events <-- New post

By this, I am adding a new post into Rallies shows & events, however, if I move to another category then Rallies shows & events remains persistent.

At the top of the code I have this to kill the required session USES_forumID:

<?php
@session_start();
if ("" == ""){
// WA_ClearSession
$clearAll = FALSE;
$clearThese = explode(",","USES_forumID,USES_access");
if($clearAll){
foreach ($_SESSION as $key => $value){
unset($_SESSION[$key]);
}
}
else{
foreach($clearThese as $value){
unset($_SESSION[$value]);
}
}
}
?>


Then I create a new recordset to enable me to get the session ID for the correct category:

$colname_rs_forumname = "-1";
if (isset($_GET['catID'])) {
$colname_rs_forumname = $_GET['catID'];
}
mysql_select_db($database_conn_mrs, $conn_mrs);
$query_rs_forumname = sprintf("SELECT * FROM tbl_forumNAME WHERE fld_fnID = %s", GetSQLValueString($colname_rs_forumname, "int"));
$rs_forumname = mysql_query($query_rs_forumname, $conn_mrs) or die(mysql_error());
$row_rs_forumname = mysql_fetch_assoc($rs_forumname);
$totalRows_rs_forumname = mysql_num_rows($rs_forumname);


And then I reset the session USES_forumID:

<?php
if (!session_id()) session_start();
if(!($totalRows_rs_forumname == 0)) {
$_SESSION["USES_forumID"] = "".$row_rs_forumname['fld_fnID'] ."";
}
?>

Is this too much for a page to handle? Have I done something wrong?

Basically, the first forum category I visit is set by the session and remains persistent even when moving from one to another.

I have attached the top level forum page (forum.php), the results (forum_results.php) list for individual categories and the insert page (forum_insert.php) for you to see if you want to.

Sign in to reply to this post

Jason ByrnesWebAssist

There are no attachments to your post, please attach the pages in question so i can examine the code in context.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...