close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Error with rsobj.php

Thread began 1/10/2019 8:15 am by anonymous | Last modified 1/10/2019 11:27 am by Ray Borduin | 1741 views | 12 replies |

anonymous

Error with rsobj.php

My website shows navigation elements based on a users's access_level. All of a sudden, the system is not recognizing the access_levels and it is thinking that a user is assigned to all access levels. When I view the errors, it points to line 196 in rsobj.php. I didn't make any changes to this file. Here is the recordset that tells the system what access level they are: <?php
$logged_user = new WA_MySQLi_RS("logged_user",$sdpc_i,0);
$logged_user->setQuery("SELECT * FROM ((SELECT * FROM users where username = ?) t1 left join (SELECT * from associations) t2 on (t1.userID = t2.userID) left join (select * from access_levels) t3 on (t1.userID = t3.userID) left join (SELECT * from districts) t4 on (t2.districtID = t4.districtID) left join (SELECT * from software) t5 on (t2.softwareID = t5.softwareID))");
$logged_user->bindParam("s", "".$_SESSION['username'] ."", "-1"); //colname
$logged_user->execute();
?>

I have attached my rsobj file also. Any suggestions would be helpful. Thanks

Attached Files
rsobj.php
Sign in to reply to this post

Ray BorduinWebAssist

I'd have to debug the page in place. It could be an issue with the database, connection, page, or rsobj file. Can I get FTP access and a url to debug it?

Sign in to reply to this post
Did this help? Tips are appreciated...

anonymous

Here is the url of the site: https://secure2.cpsd.us/sdpc. The error is on all pages. It isn't a database or connection error because, data is displaying throughout the site. It is just an issue with the navigation bar. The site is logging people in but, not showing the info in the navigation bar based on the access_level. My company won't let me provide FTP info but, I am attaching a sample page from the site. I hope this is enough.

Attached Files
view_alliance.php
Sign in to reply to this post

anonymous

Did some more testing and it appears the SESSION username isn't being stored and sent to the pages. Any thoughts?

Attached Files
view_alliance.php
Sign in to reply to this post

Ray BorduinWebAssist

Does session variable saving work in general on your site?

Try setting a session variable on one page:

php:
<?php

@session_start();
$_SESSION['test'] = "works";
?>



and then write the value on another page:

php:
<?php

@session_start();
echo(isset(
$_SESSION['test'])?$_SESSION['test']:"doesn't work");
?>



If session variables aren't working in general, then this is probably an issue with the session.save_path setting in your php.ini, usually pointing to a non-existent folder or the folder doesn't have the correct permissions.

If session variable settings do work in general, then it must be an issue where the session variable is stored in the first place. I'd need to see a copy of the page that saves that value to see why it might not work.

Sign in to reply to this post
Did this help? Tips are appreciated...

anonymous

This worked. I am attaching my login page for you.

Attached Files
login.php
Sign in to reply to this post

anonymous

So on one page, this recordset SESSION username doesn't work:

<?php
$logged_user = new WA_MySQLi_RS("logged_user",$sdpc_i,0);
$logged_user->setQuery("SELECT * FROM users inner join associations on users.userID = associations.userID left join access_levels on users.userID = access_levels.userID left join districts on associations.districtID = districts.districtID left join software on associations.softwareID = software.softwareID WHERE users.username = ? group by access_level");
$logged_user->bindParam("s", "".(isset($_SESSION['username'])?$_SESSION['username']:"") ."", "-1"); //colname
$logged_user->execute();
?>

But on the same page, this recordset does work:

<?php
$account = new WA_MySQLi_RS("account",$sdpc_i,1);
$account->setQuery("SELECT * FROM users WHERE username = ?");
$account->bindParam("s", "".(isset($_SESSION['username'])?$_SESSION['username']:"") ."", "-1"); //colname
$account->execute();
?>

Attached Files
login.php
Sign in to reply to this post

anonymous

Here is a screenshot of the error message I see when I am logged in. When I am logged out, I see the second screenshot.

Sign in to reply to this post

Ray BorduinWebAssist

You have blank lines in your login page php code. That can cause sessions to not work properly. Try removing those and see if it helps.

If you still have issues, I'll need FTP access and a URL to reproduce the errors in order to debug this properly.

Sign in to reply to this post
Did this help? Tips are appreciated...

anonymous

That didn't work. I have TeamViewer. Can you login and use that to see my site?

Sign in to reply to this post
loading

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