login session data
login session data

Hi everyone,
I was trying to accomplish the following them someone on stackoverflow suggested using datatables. The product looks great but I have been having some trouble.
my requirements:
1. Have users login to the website. This have been done using php and a sql table. the logged in user id is stored in a table and stored as $login_session variable.
2. I would like the data to be stored where the $login_session is stored under the User column of my database.
3. I also would like to show the data where the User column matches the current $login_session
I have gone through the documentation but so far I have only been able to run the examples with my database. The simple example is connect to my table and displays the data. not sure how to proceed to accomplish 2 and 3. Everytime I try to insert a query the example stops working.
Hopefully am able to get this working within the trial period.
Thanks
This question has an accepted answers - jump to answer
Answers
apparently I was approaching the whole problem incorrectly, read the manual a few more times and was able to accomplish my goals.
the only trouble now is that the login page send the sessions login id as a variable to the staff.php page to run the query, if I am logged out and manually enter the database page i get a jason error. anyway to turn it off?
Trial period us about to end and I still have not figured this out. Can someone help?
You're not explaining your problem(s) very clearly. It would be more useful if you would provide a link to a page showing the issue.
http://urlgone.com/fb3a39/
if a user is not logged in, i get an error. I do not understand what this error means and secondly if possible i would like to change the error message.
The console error is:
datepicker is not a function.
$( "#datepicker" ).datepicker();
What datepicker did you intend using? Did you reference its js anywhere?
Use your own browser's console for further debugging.
I actually get a pop up "DataTables warning: table id=example - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1"
i am using the datepicker function in one of the fields.
could you tell me which file is returning this error?
Hi,
There are two separate issues:
index.php
. That is not valid JSON and therefore DataTables shows an error message. I would suggest adding some logic intosimple.php
to detect if the user is logged in or not. If they are not, redirect them.#datepicker
element on the page, so I don't understand why you would have that code there. Unless you plan to add a date picker, then just remove that code.Allan
Thanks Allan,
I removed the datepicker, it was placed on this page in error.
I have been working on including the logged in logic to the simple.php page.
thanks again. you can close this thread.