How to create data validation steps

Good morning all,

I am new to cakephp. Here is my concern, I am practicing to design an online subscription site. The customer arrived on the site clicks on an offer to subscribe and must be redirected to a customer information registration form then after validation, is directed to another page which displays the details of his subscription and finally he confirms his subscription . The problem is that I don’t know how to go about keeping information in memory at each stage of form validation.

Could help me to have a tip or method to overcome this problem. I thank you in advance.

I’m using the cakephp 3.8 version

One common way is to use sessions. This one of the strategies use by the Authentication plugin too.

I have a customer table, an offer table and a subscription table and I would like to use the customer table for authentication but this does not go out. I have reserved the user table for the administration part. Do you have a solution for me? I’m grateful to you.

Are you trying to save the customer record to a session so you can retrieve it on subsequent requests?

Can you share some code showing where your process is failing?

I present you the codes that I put for the authentication of the customers before they subscribe to an offer


Client Entity
Template login

When client want to subscribe

at first, the client’s authentication does not work after creation of his account.

How is it failing?

  • Is there an error message?
  • Are the expected records being created in the database?
  • Is the password hashed in the database as expected?
  • Is there any Auth data showing in the session?

How is it failing?

the records are created in the database
passwords are hashed

But when I try to connect a client, I get the following error message: email or password is incorrect

You’re trying to log in with a user record stored in the clients table? What steps have you taken to set that as the table that will be used for authenticating those logins?

I changed the code in the AppController file

Nothing about this changes what table it will be looking in. It changes what controller will be used, but that controller just calls $this->Auth->identify(), and by default that’s going to be using the users table.

In this case do you have a solution for me?

I am a beginner in cakephp

Documentation is here, see the userModel key.

Thank you. I consult and I come back to you

Thank you all for your help