:( ::)
Hello there,
I recently started Web Designing with PHP, Javascript and AJAX.
I am facing a problem which I will try to explain:
If I am successful in conveying the problem to you clearly, could you
pl. suggest me some solution? Thank you,
Here is the problem details:
I successfully created a Registration/Login/Logout system with CMS
features by learning through tutorials/forums like yours, using PHP/MYSQL
only. Thanks to the internet.
I want to Ajaxify the code using the Javascript programming and
XMLHttpRequest Object.
So the question I asked to myself is:
Can we login without refreshing the current page? In theory and
practice I am able to validate/check the username , password and get
back the results array from mysql without refreshing the page.
I am facing the Problems after this:
How do I retain myself in that State of LOGGEDIN situation? The answer
to this is(probably): $_SESSION variable.
But at this point I got stuck: Where should I use session_start() and
where should I assign the SESS_MEMBER_ID ? Is it in the index.php
which is the main page (which has the login screen) or is it the 'php
script' which checks for user name, password
and sends back the results. I tried adding the session code to "php
script" under the login submit button. It successfully gives me the
session id.
However, if I refresh the page, I loose that session ID:
so, my doubt is where exactly is session ID stored ? On the server or
on the client machine like a cookie.
How do we retain it ?
Its similar to when I log into yahoo / gmail account, even if I
refresh, I wont be logged out to main screen.
How is this possible without refreshing the form.
Could you pl. help on this.
Thank you very much for your time.
regards,
sincerely,
Prasad.
Hello there,
I recently started Web Designing with PHP, Javascript and AJAX.
I am facing a problem which I will try to explain:
If I am successful in conveying the problem to you clearly, could you
pl. suggest me some solution? Thank you,
Here is the problem details:
I successfully created a Registration/Login/Logout system with CMS
features by learning through tutorials/forums like yours, using PHP/MYSQL
only. Thanks to the internet.
I want to Ajaxify the code using the Javascript programming and
XMLHttpRequest Object.
So the question I asked to myself is:
Can we login without refreshing the current page? In theory and
practice I am able to validate/check the username , password and get
back the results array from mysql without refreshing the page.
I am facing the Problems after this:
How do I retain myself in that State of LOGGEDIN situation? The answer
to this is(probably): $_SESSION variable.
But at this point I got stuck: Where should I use session_start() and
where should I assign the SESS_MEMBER_ID ? Is it in the index.php
which is the main page (which has the login screen) or is it the 'php
script' which checks for user name, password
and sends back the results. I tried adding the session code to "php
script" under the login submit button. It successfully gives me the
session id.
However, if I refresh the page, I loose that session ID:
so, my doubt is where exactly is session ID stored ? On the server or
on the client machine like a cookie.
How do we retain it ?
Its similar to when I log into yahoo / gmail account, even if I
refresh, I wont be logged out to main screen.
How is this possible without refreshing the form.
Could you pl. help on this.
Thank you very much for your time.
regards,
sincerely,
Prasad.
Comment