PHP session problems -
i have part of site when user (not logged-in) can rate on form 1 - 5. form , backend works perfectly.
i made when form posts, trips $_session['rated']; equal one. have immediate redirect origin page. on origin page, original rating form is, if $_session['rated']; = 1, form invisible, if it's 0 (by default) form shown.
it worked first time, since i've not been able stop session or unset variables in way. i've tried different browser, clearing cookies, doing this:
session_start(); session_unset(); session_destroy(); but nothing clears session, , form still shows invisible because $_session['rated']; still equals 1.
what should do?
you wrote if $_session['rated']; = 1
check code, if use = (the assignment operator). if do, that's culprit – compare values in php (and other c-like languages) use == (comparison operator)
Comments
Post a Comment