Jump to content

Add Review Without Logging In


webref.eu

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/136082-add-review-without-logging-in/
Share on other sites

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.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.