User Friendly Registration System - php

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 :)

Related

Approving information prior to storing in database?

I am developing a web-based iPhone app and possibly a PC friendly website version as well. The goal here to to allow users to submit a form where specific input values would be stored into a table in the database.
Mind you this information is being gathered for public display and will be posted onto a calendar or list.
However, to prevent from any trolling or spamming, I'd like to make it where submissions have to be approved prior to being submitted into the table.
I have no problem with creating the table, connecting to the database, storing input values into the corresponding table columns. The only issue is how would I go about setting up an approval system? Can I add information to a table via email? Is there a way to approve admissions in cPanel?
This is something that I would like make as smooth as possible, I am expecting a lot of submissions daily with quite a bit of information.
You can have two approaches for this.
Approach 1
Have two copies of the table (which you want to save information
into). The first one should be named tableName_Input. The second one
should be tableName_Final.
Any Data in '_input' is considered raw and needs approval. Once approved the data will be moved into '_final'. The LIVE list/calendar always read from '_final' data.
Approach 2
Have a column named 'isApproved' with a flag 0/1. If 1 it is approved, else it is not. Only show data that is Approved.
Now, how do you get the data approved ?
You have a hard fast rule like spam filter that tells certain post is valid and approved by default
After every post, you send the user an email or some notification (unique to the user - post) that when answered back, shall mark it as approved.
Optional: You can place a column called as 'approval comments' to fill in something at the time of approval.
Flow chart
Tables
'FirstSubmitContent' - Table to store user submitted information
prior to approval.
'FinalSubmitContent' - Table that stores the final information
Code Pages
Content Page --> Contains the form the user fills the content
ContentActionPage --> Calls the controller --> calls the Model
Controller --> calls the model based on page action
Model --> Interacts with the Database table
I do not have any tools at my disposable now to write more detailed Code or Flowchart. I hope this puts in the right direction.
Validate the form on submission and save info in a temporary table in your DB with a randomly assigned activation code (you could use sha1). Then send an email to user with activation code and a link to verify it, ie. domain.com/activate.php?code=abcde12345.
The activation page can be very simple with just a $_GET['code']. Then check if you find a match in the DB for that code and finally prepare your query with all the info you gathered before to store it permanently.
Then you can make a cron job to delete all records from that table every 24-48 hours so users will have to activate within that time range.

Controlling if a Submit button has been clicked once or more times

I have a registration form for groups of people, with 2 Submit buttons: (1) Add a participant, (2) Submit group registration.
When 'Add a participant' is clicked the first time, I want to create a database entry in some 'group' table (that will group together any participant added in that group). But then, when more participants are added as the group registration process continues, of course I do NOT want any more entry in this table. Just once.
It may sound silly but I can't seem to find a way to do that easily. Any idea? (I work in PHP with WordPress)
This is not a silly question and I don't see a way to do it without at least two buttons, or button-like elements, on a form. It is common to see this. For example, "Continue Shopping" and "Go to Checkout", not to mention the "Cancel" button. That shouldn't be confusing but don't get carried away with it.
This comment seems to be the key reason for your question:
someone decides to register several people at once to get a group discount
Based on this statement, I am working from the assumption that everyone has to register at the same time for this discount to take effect. That is, you can't register three people then come back later and register three more.
And the basic problem seems to be that you want to track how many times the form is submitted. Don't do that. Tracking how many times the form has been submitted is going to be a real headache. Rather than auto-generate a group the first time somebody registers, have an intermediary form for group registration. You'd have:
Register (Optional: Explanatory page with link(s) to the actual registration form)
Register Group (You can just generate an ID or have people name the group. This ID gets passed to the "add member" form)
Add Member (You can submit a member and redirect back to this form for another member, or hit "done" and go to a "Group" checkout form)
At the "Checkout" form you list group members and provide payment options. No idea how you plan to accept payment but it doesn't matter. Presumably you have some third party (Paypal, etc) to handle that.
Basically, you are tracking as much as closely as you can how the big shopping sites handle purchases so the whole thing stays as familiar as possible.
You can also have a "Single" registration form if you need one.
I don't know how you plan to prevent the spamming of this form. I'd suggest email verification at the group registration stage. That is, require some contact information from whomever is registering the group, send an email, and lock that group's registration until an email is returned. Spammers are unlikely to jump through that hoop.
You mentioned that you are using WordPress, so use wp_cron to clean up failed or abandoned registrations after some time limit-- 24 hours, three days, whatever.
Once the system works you can hijack it with Javascript and make it more dynamic, if you want.
Have a list of groups available for the 'create participant'. If a radio button (or similar) is selected for 'new group' (with appropriate info filled in) then create it when the participant data is submitted. Check for duplicates first, though.
As #ayman said - having two submit buttons is not a great approach. You will confuse your users.

php form submit counter

So I've made an extremely simple 4 page static webpage for this client with a quick contact form handled by php. Everything goes swimmingly.
Then the client comes to me and requests that he is able to see a counter of how many submits have been made. So he generally wants a counter for his form, Which is simple enough because I just add a counter for every successful email sent using the form and save it within some kind of data storage.
BUT...
the only way I can think to do it is have a separate user page with a simple box that has the number in it, that only the client can access.
I could do this... Save the counter in an xml file or a one table, one column, one row mySQL database.
But is there a better easier simpler way to do this??? Can I set up a link with Google analytics or something? Rather than making a single page with a number on it.
I suggest going with a separate page for the client to view counts. You can use .htaccess to control the access to this page. The main reason is looking forward to future client requests. Most likely, they will then ask you to show counts for specified periods of time, counts per day/week/months, etc. If you set up your page now, then you can have place to customize/extend.
As for storing the counter, I would suggest storing more than just the total. Have a table where you'd store:
date/time of form submission
remote IP address (for possible future reference)
content of the submitted form (if the client ever decides to want to see it)
maybe event content of the email (if the client ever decides to want to resend it)
Then to display the totals, you'd just select count(1) from that_table with any required date/etc. grouping.

Customer wants a Relate button like a Facebook Like button

A customer wants a button that says "Relate" that would be kind of like the Like button in Facebook. It would show how many people clicked the button inside an article. Is there an easier way to do this besides creating a table in MySQL and use PHP?
I suppose you could use a CGI script written in bash that read/writes a plain text file that stores the click count. But one way or another you're going to have to have some kind of server-side handling and data storage. Doesn't have to be PHP/MySQL, but you'll have to use SOMETHING.
If you want to use data gathered across multiple sessions by multiple people, you're going to need to store that data. Whether you store it using databases, textfiles, or carve it in a tree is up to you.
Yep, instead of creating a new table, just add a column likes INTEGER(11) to articles table. Whenever someone clicks the "relate" button just add count by one.
You may also want to disable button after user has clicked it. You may want to store the info liked:article_id in cookie to make sure user do not adds fake "relates", unless he clears cookie. But tracking logged in user is different (but more appropriate) game.

Should I use sessions for "LOGINS" on my site?

I have a classifieds website, where anyone (no need for login currently) can post a classified. It is PHP based.
The procedure for posting is currently like this:
click on "New Classified" --->
fill in a form of all information and hit "View classified before publishing it" --->
the form submits to a "verify classifieds" page, where users verify their inputs --->
If everything is okay in the "verify" page, then the user hits OK and the classified is published.
The above procedure isn't exactly optimized. The first page (new_classified) where the form is, is pretty good, but the second page (verify) uses x number of hidden inputs in another form, used to contain the previous pages form inputs.
Now you know how it works on my site.
The issue today is that alot of companies want to publish their classifieds, and alot of classifieds at the same time. This means they have to fill out the form again and again currently.
I am thinking about creating a login, for companies only, so that their information is automatically inputted into the form, so all they would have to do is fill out the specific classified details like "headline" and "description" etc.
How should I do this in my case? Sessions?
This means I will have to create a new MySql table (I use MySql mainly) and store company-profiles there.
So do you think converting to sessions is alot of work? Worth it? More reliable?
I have never used sessions so I wouldn't know.
As a last note, you should know that I use a picture upload tool on the first page of "new_classified". When a user choses a file to upload, the page is automatically *refreshed*, and then the image is displayed on the same page under section "images uploaded". I hope the session wont interfere with this approach.
Thanks
I think it is worth your while to do logins, and even on a very basic level it will help you to identify who is using your site etc.
This is probably a big debate around developers, what is the best way to do a good login system, whether it's basic or not doesn't matter, I think the concepts still stay the same.
In your case I would suggest session cookies along with a login table consisting of user details. This would help you to verify the user on more than one occasion during his/her visit to the site.
A login is checked against a user entry in a table and then a session cookie is created. This session you can choose to never expire also.
You can then on every step check that the user is the user that is supposed to be logged in and get the companies details by checking the username. This would make for a better query in my opinion.
Sessions aren't a lot of work and it's relatively easy to learn.
http://www.php.net/manual/en/book.session.php
http://www.9lessons.info/2010/02/php-login-script-with-encryption.html is a good example of what you can do with this. Have a look around still. There are a bunch of these great tutorials on the web.

Categories