Should we keep User Registration and User Update forms separate - php

I have a user registration form and a user information update form. All the fields in both the forms are the same. So should I use the same registration form as User update form, on which all the information is fetched from database and is displayed on in the relevant fields. Please suggest me a solution. By the way I am doing all this stuff in Codeigniter.

That's probably not such a good idea, as a user registration form is usually available publicly, but a user update form should be behind a secured area / firewall and you should set up access control for who should be allowed to update a user (eg. only the user themselves and admins).
But if you write your code in such a way that the forms can be reused in different context, then you could use the same code for both pages.

Related

CakePHP highly integrated SignUp Form

I just wonder how to build up a signup form like this with cakephp 2.x:
A member can have multiple workingtimes and multiple vacationtimes.
There should be one large signup form with one submit button and 3 visually separated areas: memberdetails, workingtimes, vacationtimes.
During signup a member should enter his personal data inside memberdetails and add arbitrary workingtimes as well as arbitrary vacationtimes in the designated areas before hitting the submit button. All the entered times should be listed tabular inside the form before submitting the whole form. At some point the memberdetails, workingtimes and vacationtimes look good and the user submits the form(I know that this is only the ideal situation and there are missing some functions).
My first approach was including the forms for adding workingtimes and vacationtimes inside the members form and send serialized form data via Ajax-POST to the other controller actions (Workingtime->add, Vacationtime->add) and also load the whole related data with something like a crud index function via Ajax and inject the response into the signup form without reloading it. This seems to keep things like validation, security component or the view layout simple, because most of the work will be done by cakephp and not with javascript, but I think it only works if I have allready a database ID for the member - after this I can store workingtimes and vacationtimes. Like allready said, I would prefer one form with one submit button and be able to cancel the whole registration even if there where allready added workingtimes or vacationtimes.
So what is the cake way to achive an integrated form like this? Is it useful to start a transaction and create a dummy member when the form is loading? And then use the ID of this dummy record to store the related workingtimes and vacationtimes? And when hitting the submit button the dummy member is updated to store the entered personal data and everything can be commited? Or should the entered related model data only be validated without saving and then just cache these data for a final transaction block?
Any other ideas?
I think the best approach for this is to manage states. Allow user to enter the basic data, change state, and then you can ask for more information but you will have already a user id to associate and match info. If the user comes back later it will have the current state already.
With Cake, a Component would help you to go from one step to another. Each data you enter should be validated.

Symfony: Order form with option to login to load user details

I've been working on an order form for a type of webshop. I intend to use Craue Form Bundle to split up the form over several pages. At the end of the order, the user is asked for his details (address, phone, ...). However, I also want to give the option to log in at this stage, and then load the user details from the database instead (with the option to change them if they're no longer correct).
Of course, the order process should not be disrupted if the user submits the login form.
How would I do this with Symfony3?
I thought maybe the best idea would perform the login through AJAX
and then fill out the form details when the response comes.
Or I could store the already filled out order details in the session,
but that would require submitting the entire form, not just the login
part of it.
But all this requires deviating from Symfony's way of doing things, which is bound to cause some trouble.
Just wondered if you have any good ideas or ready-made code out there? I seem unable to find anything that suits my needs.

PHP putting a connection open while filling a form

A simple form to take user details but I want that if a user is already registered and if he enters his NAME then that script should search it in database and show his details in the form fields before submitting the form.
If I'm understanding you correctly you want a form where the user starts typing in his username and it will display the rest of his information automatically if his username exists in the database? Well in order to retrieve information from a database on the fly while a user is typing in the information (without refreshing the page) you will have to use Ajax.
But logically why would you want a form to search a database just based on a name and display the rest of that username's information before they have logged in or submitted the form? I think you should retrieve a user's details ONLY after you have verified who they are. Not just by them typing in a name. Maybe I am misunderstanding your question though.

User Friendly Registration System

I need to build a registration system which requires the collection of large data (many fields) from the user registering which is then inserted into a couple of tables in a database.
I don't really want to display a very long form to the user for the purposes of better UX.
This system will not run online, it is just a web app to run on the desktop.
I need help, pointers, references, etc on how I can better organize the registration process to make it more user friendly.
This How to encourage a user to fill in long application forms? has been helpful so far
As long as you don't mind requiring your user has Javascript, I would use AJAX. Let's say that you have 50 fields that you can logically combine into 4 different sets - the first may be about the person asking for name, email, etc., while the next set asks for historical information or employment information - like on an application.
Make one form for each set, and then present a new user with the first. When he completes the first page, instead of a "Submit" or "Register" button, use an AJAX call and a "Next" button to get the info and switch to the next page of the form with the next set of fields. You could use the AJAX calls to hold the information in a temp table in your database, and then, once the entire process is complete, you can write it to your member/users table.
You could do like other surveys or checkouts do and add a "title" for each page of the form above the form fields so that as a user moves through registration, they can monitor their own progress.
I'd recommend checking out the Amazon checkout, or really any multi-page survey (you may even be able to set one up yourself on Survey Monkey) to see how a large number of form fields can be broken down logically in a user friendly way.
Hope it helps.
Check out this link: http://www.smashingmagazine.com/2011/05/05/innovative-techniques-to-simplify-signups-and-logins/
It's talking about login- and registration-forms and how to make them more user-friendly. A suggestion which is also included in this article is as follows:
At registration don't ask the user to many questions. Only the basic data like their name for example. Then ask him about more detailed data when the user logs in the first time. This way the registration won't take too long.
Maybe this helps you out :)

Drupal Register user upon node create

How can I add user register form to node create form in Drupal? There is a module http://drupal.org/project/inline_registration , but it has some bugs. I think I saw alternative one, but I cant find it now.
Beware the many security problems possible when giving essentially anonymous users access to node creation. That said, here are some thoughts.
If you can live without having the form registration on the same page, a much easier solution would be to redirect the user to the node create form after successful login. This amounts to perhaps just one line of code (more if you only want to redirect on certain conditions - e.g. the user registers for a certain type of account). That way you can use the built-in validation and submit handlers of the user module.
If you must have both on the same page, you could use hook_form_FORM_ID_alter, and output the user registration form fields if $form['#node']->nid isn't set. Be sure to validate the input as well.

Categories