webref.eu Posted December 8, 2008 Share Posted December 8, 2008 Hi All I am currently writing a reviews script. I want to make it as easy as possible for reviews to be contributed. With this in mind, I want someone to be able to create a review, without having to log in first. However, once they have submitted the review, I want them either to log in to their ac so it gets attributed to them, or to register for an account. If they don't do this, the review will just get attributed to guest. If I want to do this, can anyone suggest the kind of mechanism I will need to use. Will I need to use a session variable to control the whole review submission process? I know it's a general question, but any thoughts are welcome. Thanks all. Quote Link to comment https://forums.phpfreaks.com/topic/136082-add-review-without-logging-in/ Share on other sites More sharing options...
premiso Posted December 8, 2008 Share Posted December 8, 2008 Use session to hold the new review_id. Then once the user logs in, check for this id, if there is an id pending then update the review table where the review_id is equaled to that session id and assign it to that user. When you insert the review, assign it to guest by default, then just change it when that user logs in. This way if they do not login with that session it is just assigned to guest, if they do the code executes and changes it to that user. Quote Link to comment https://forums.phpfreaks.com/topic/136082-add-review-without-logging-in/#findComment-709553 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.