Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can achieve this by storing data either into a session variable array or temp database table. I would prefer to store it in session.</p> <p><strong>If you are doing it using session then it can be:</strong></p> <p>When user clicks on submit, do you check that the user is logged in or not? If yes, then store data into a table. If not, then store it into a session array, say <code>xyz[]</code>. After storing it, redirect the user to a login page. After login, you can check if the session array <code>xyz[]</code> contains any value. If it does, store it into a particular table and don't forget to <strong>unset</strong> session array <code>xyz[]</code>. Otherwise, redirect user to <strong>home</strong>.</p> <p><strong>If you are doing it using the DB then it can be:</strong></p> <p>When user clicks on submit, do you check that the user is logged in or not? If yes, then store data into db table. If not, then store it into a <strong>temporary db table</strong>. After storing it, redirect user to login page. After login, you can check if the <strong>temp db table</strong> contains any record. If it does, then move it into a particular table and don't forget to <strong>delete</strong> record from the temp db table. Otherwise, redirect user to <strong>home</strong>.</p> <p><strong>or else best way</strong></p> <p>In starting of your form just check if user logged in or not? if <strong>not</strong> then redirect him to login page. Otherwise, allow them to fill data in form.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload