close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Store and Keep Session when record set is updated

Thread began 8/27/2014 9:32 am by mycalidesigns | Last modified 8/27/2014 10:33 am by Jason Byrnes | 821 views | 3 replies |

mycalidesigns

Store and Keep Session when record set is updated

I have a page were I am passing a form variable and storing as session variable when directed to new page. I have a recordset that uses a GET function to update table. When the recordset is updated on the same page i loose my session.

How do i keep my session when updating a recordset and staying on the same page. The recordset has nothing to do with session.

Sign in to reply to this post

Jason ByrnesWebAssist

send you page please so i can see the code.

Sign in to reply to this post

mycalidesigns

Jason, always thanks for you prompt response greatly appreciated. I have a form that passes a variable to page i attached. The issue is on this page i have a recorded that updates when client picks a certain option.

Two issues

1. the form on step-2-session.php passing the value doesn't update the Session $_SESSION['totalguestcount'] on the menu-items.php page

2. $_SESSION['totalguestcount'] on menu-items.php gets lost when recordset is updated based on $_GET function from links

I attached both pages.

step-2-session - menu-times.php

Sign in to reply to this post

Jason ByrnesWebAssist

1) the form element on the step 2 session page that passes the guest count is named fieldset_group_Select_One:
<select class="formMenufield_Medium" name="fieldset_group_Select_One" id="fieldset_group_Select_One" rel="<?php echo((isset($_GET["invalid"])?ValidatedField("testguests","fieldset_group_Select_One"):"")); ?>" tabindex="1" title="Please enter a value">

2) the form on that page is set to use the post method:
<form class="NewFromBlank_Default" id="Default_NewFromBlank_Default" name="Default_NewFromBlank_Default" method="post" action="menu-items.php">

3) on the menu items page, you have 2 pieces of code to set the guest count session:
<?php
@session_start();
if("" == "") {
$_SESSION["totalguestcount"] = "".$_GET['totalguestcount'] ."";
}
?>
<?php
session_start();

// store session data
if (isset($_SESSION['totalguestcount']))
$_SESSION['totalguestcount'] = $_POST['fieldset_group_Select_One']; // or if you have any algo.
?>

the first one should be removed since the get wont pass the selected value, it will be passed by the post.

in the second one, you should use the fieldset_group_Select_One post element as the trigger:

<?php
session_start();
// store session data
if (isset($_POST['fieldset_group_Select_One'])) {
$_SESSION['totalguestcount'] = $_POST['fieldset_group_Select_One'];
}
?>

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...