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

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Recordets and Regions

Thread began 8/03/2009 6:44 pm by Paul | Last modified 8/05/2009 5:44 pm by Eric Mittman | 970 views | 3 replies |

PaulBeta Tester

Recordets and Regions

I have used SA to create a registration system.
I'm looking to add the following functionality.
When a user logs in and updates their profile...

The user is taken to a confirmation page which has two show regions.
1) show a message if the recordset is 0 (Off)
2) show a different message if the recordset is 1 (On)

The regions are based on a rule created using the following recordset

The recordest is built when the index page displays after the profile is updated.
The rs pulls the user record that matches the $_SESSION['UserID'] and includes a ProfileUpdate field that contains either a 1 (On) or 0 (Off) value.

Ok, so thats the logic.

When its all in place, i'm not seeing either region text, when I know the recordset created, contains one user record which will have a 0 or 1.

My access rule looks at the recordset and pulls the ProfileUpdate variable and compares against 1 for my 'On' rule and 2 form 'Off' rule.

Just can't figure out why its not happening!
Advice welcome.

Paul

Sign in to reply to this post

Eric Mittman

I'm a little confused about how you have this rule setup. It sounds like you have the userID and the updatable variable held in the session after the index page. Are you basing the access rule on these session variables? You mention that the access rule looks at the recordset, this is usually not the way you should have the access rules setup. If you are referencing recordset values in your access rule this could be the reason for it not working as the recordset values have limited scope and are only available on the page that the recordset was created on.

If your access rules are based on session variables one way to check on the status of these variables is to dump the contents of the session array, in PHP you can do that by adding this code:

<?php
print("<pre>");
var_dump($_SESSION);
print("</pre>");
?>

If you place this code into your page just before the display areas you should see what the values of the session variables are. If you continue to have trouble with this post back with the results you get and any other info along with how the rules are setup specifically in the access rules manager.

Sign in to reply to this post

PaulBeta Tester

Recordets and Regions

Eric,

A little background.
My users table includes a ProfileUpdate field where the value is set according to the user when they login and visit the profile update page.
There are 2 option 0 (Off) and 1 (On)

When the user has updated their profile they are redirected to the index.php page where a recordset is run to determine the current value of the ProfileUpdate field.

It'll either be '1' or '0'.

Now, in my show region #1, i'm validating the recordset value <?php echo $row_rsUserProfile['UserProfileUpdate']; ?>=1 to allow the show region #1
and <?php echo $row_rsUserProfile['UserProfileUpdate']; ?>=0 to allow the show region #2

I figure in theory this should work, but neither region shows despite the recordset returning the values 1 or 0 on the index.php page ok.

The reason i'm using a recordset and not a session for the same value, is that if the user updates the ProfileUpdate in their profile, the session will be holding an old value. Whereas the recordset returns the up-to-date value from the table.

Are you saying that the rule cannot work with a recordeset value on the same page?

Incidentally, the script snip in your post returned all the session values expected when placed in my index.php page.

Sign in to reply to this post

Eric Mittman

The way you are using the recordset values to base the show region should be fine but if it is not working then there is either a problem with the value or the way you have it implemented.

It may be worth trying to use session variables to store this value, on your profile page when you update it you can also update the session variable that holds this value, then base the show region on this session variable. You can use the standard set session value server behavior to set the session variable.

Since you got all of the session values to be seen the code for that is working correctly, you can leave it on the page while you are testing to ensure values are what you expect them to be. Please try updating this to use the session variables after updating the profile page to include the set session code. Run some tests and get back to us with your result, if you do not get the expected result and the session values look ok post back and let me know, I will open a ticket where we can post files privately to each other.

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