Login Required

Creating Forms for Sign up and Sign in

Dear Sciaku Learner you are not logged in or not enrolled in this course.

Please Click on login or enroll now button.

If you have any query feel free to chat us!

Happy Coding! Happy Learning!

Lecture 295:- Creating Forms for Sign up and Sign in

To create forms for sign up and sign in, you can use HTML and EJS templating language. Here are the steps you can follow:

  1. Create a new view file named signup.ejs in the views directory.
  2. In the signup.ejs file, add the HTML code for a form that accepts user input for the sign-up details. You can use the POST method for the form action attribute and specify the route to which the form data will be sent. Here's an example:

phpCopy code

<form action="/signup" method="POST">  <label for="username">Username</label>  <input type="text" name="username" required>  <label for="email">Email</label>  <input type="email" name="email" required>  <label for="password">Password</label>  <input type="password" name="password" required>  <button type="submit">Sign up</button> </form>

  1. Create a new view file named signin.ejs in the views directory.
  2. In the signin.ejs file, add the HTML code for a form that accepts user input for the sign-in details. You can use the POST method for the form action attribute and specify the route to which the form data will be sent. Here's an example:

phpCopy code

<form action="/signin" method="POST">  <label for="username">Username</label>  <input type="text" name="username" required>  <label for="password">Password</label>  <input type="password" name="password" required>  <button type="submit">Sign in</button> </form>

  1. Render these views in their respective routes in the auth.js controller using the render method of the response object.

That's it! You now have forms for sign up and sign in that can accept user input and send it to the server for processing.

34 Manual Authentication
🎬 10 videos

Course Certificate

Complete 100% to unlock your certificate

Sponsored

Course Discussion

2 Comments

@niteshguptav63
niteshguptav63 Nov 17, 2024 at 8:09 AM

I am not able to access videos from second class and further. I have already completed first class

@niteshguptav63
niteshguptav63 Nov 16, 2024 at 5:26 AM

When will I get my course?

@admin79
admin79 Nov 17, 2024 at 7:59 AM

Now, Your query was resolved.

Frequently Asked Questions About Sciaku Courses & Services

Quick answers to common questions about our courses, quizzes, and learning platform

Didn't find what you're looking for?

help_center Contact Support