Building a simple wedding RSVP system with PHP? - php

I am contemplating building a website for my wedding next year. It would contain information about the event, photos and blogs from my fiancee and I.... you get the picture.
One feature i'd like if possible would be a way of letting my guests RSVP online. I envision that their physical invite has a passcode, which they enter into a text field on the site and tick whether they can or can't attend.
The passcode they entered will be compared against a secure guest-list containing names and passcodes. If it doesn't match, they receive an error message, if there is match however, the information is then relayed to me via email. I will probably build the site using Wordpress, so I would be dealing with PHP.
Can anyone recommend how i might approach this project, as being a front-end dev I have absolutely no idea and my ambition exceeds my limited PHP knowledge.
Would love to hear your ideas or suggestions.

Speaking in generalities, for this sort of thing I find it useful to start by outlining the various components of the system.
While the info pages can be static, you'll need a database to which you can persist your invite data, so I'd start by thinking about the data entities. Devise a list of entities that will exist in the system that might need data tables. E.g. invite, blog post etc.
Then think about the operations that need to be performed on those entities. Are they read-only? Do you need to create new ones, or modify existing ones? You'll need to write code to perform those operations at some point.
Then think about the various ways information from those entities might need to be presented to the user. This gives you an idea of what templates you'll need to build.
If you're thinking of using Wordpress, you can cover off the blog functionality and static page stuff using that application alone. You'd then need to think about how the RSVP functionality might be implemented separately to Wordpress, or within it as a plugin. If you're really lucky, there might be a plugin out there already that will do what you need - or something similar that you can augment yourself.
If you're new to the backend side of things I'd recommend building a blog + static page site using Wordpress, getting it "done" and then looking at the RSVP stuff as a second phase. At least then if it proves unfeasible you still have a useful working site.
Hope that helps!

I'd build this as a simple plugin for WordPress and create an additional DB table that would hold the name against the passcode (this could be auto-generated based on the ID or otherwise).
You could then make a simple admin page when you can add new guests and check the response of guests.

First: congratulations with your marriage. From what I understand you have very little knowledge of PHP so start with reading a few books or articles about basic PHP/MySql. Then, put your ideas in a drawing or flowchart and just go for it. Make lots of mistakes, learn from them, ask for help on SO or a PHP colleague or friend. And above all, have fun doing it.

If I were in your shoes I would install the contact 7 plugin. In the contact form, add passcode as a required text input. Have the results emailed to you and to them. They could make up the passcode which is the downside.
This doesn't have all the options you are wanting but you can either spend several hours writing your own php code and then trouble shoot it, or just install the plugin and be done in 30 minutes.

Related

Handcoding PHP for daily log style website with mySQL database

I only began learning about web development 3 weeks ago and have grasped html, css and js quite quickly and have also had some success in using php to draw values from a mySQL database that I have setup however I have a few questions if that is OK?
I am designing a website that essentially allows users to register and then login and add details to a daily log which is stored in the mySQL database. I also want a forum, content section and a shop. Obviously there is no standard open source package for this so I have been investigating how to handcode the PHP to log users in and have them logged in across all parts of the handcoded website. I initially thought I could do this using sessions but I have read that they are bad for SEO? I understand that you can disable them and use cookies but I fear this is all getting a bit over my head? Would it be easier to try and develop this in ASP.NET?
Apologies if some of this doesn't make sense but as I said I am very new to this but I am eager to learn and really serious about it so I will take any information given to me on board. Thanks for your time
This is all very possible in PHP, but what you are asking is for an explanation that requires a book. Speaking of books, there are tons of great books offering help with exactly what you need:
PHP 5 CMS Framework Development: Would teach you about many of the pieces you are trying to assemble by hand including MVC principles.
"Obviously there is no standard open source package.."
Just to name one, WordPress allows users to log in and add stuff to a daily log (it's called a blog), has content sections, and has forum and commerce plugins. Personally, I've been amazed at how customizable WordPress is!
I don't understand your comment about using cookies instead of sessions. I recommend you use the PHP $_SESSION superglobal to keep users logged in during their session.
If you have super-sensitive data in these logs, one option might be to verify that the user's IP has not changed between requests.
I see no reason why ASP.net would be preferable. Personally, I like to learn programming by opening up vim and going at it.
P.S. Be sure you are escaping data provided to you by users before writing it to your SQL database.

PHP - detecting changes in external database-driven site

For a homework project, I'm creating a PHP driven website which main function is aggregating news about various university courses.
The main problem is this: (almost) each course has it's own website. These are usually just plain HTML or built using some simple free CMS system.
As a student, participating in 6-7 courses, almost every day you go through 6-7 websites checking if there are any news. The idea behind the project is that you don't have to do that, instead, you just check the aggregation site.
My idea is the following: each time a student logs in, go through his course list. For every course, get it's website (recursively, like with wget), and create a hash value of it. If the hash is different then one stored in database, we know that site has changed, and we notify the student.
So, what do you think, is this reasonable way to achieve the functionality?
And if yes, what is (technically) the best way to go about this? I was checking php_curl, put I don't know if it can get a website recursively.
Furthermore, there's a slight problem I have somewhat limited resources, only a few MB of quota on public (university) server. However, if that's a big problem, I could use a seperate hosting solution.
Thanks :)
Just use file_get_contents, or cURL if you absolutely have to (in case you need COOKIES).
You can use your hashing trick to check for modifications but it's not very elegant. What you want to know is when was it last changed. I doubt this information is on the website, but maybe they offer an RSS feed or some webservice or API you can use for this purpose.
Don't worry about doing recursive requests. Just make a new request each time.
"When all else fails, build a scraper"

Large HTML Form - User Experience and Accessibility

i have a large form with a lot of fields. I used fieldset on it. How could I create a better experience to user/accessibility with this large form?
I think about split it. What do you think about it?
Don't re-invent the wheel and confuse the user. Keep it simple. You could break the form down into separate parts, either into separate steps or pages and even with a progress indicator to keep the user informed of where they are.
Form design patterns:
http://patterntap.com/tap/collection/forms
It would be much easier to answer this if I knew a little bit more about the form and what kinds of users you want to be accessible for (ie - you would want to use different techniques if you are trying to be accessible for seniors than you would use if you want to be fully accessible for sight impaired users). Rbaker gave you a tremendous answer and I encourage you to follow his advice/read the link he provided.
However, I would like to add one thing. There is no rule that says that a form has to appear on one page. There is also no rule that says that a 'form' cannot consist of a number of individual questions. Depending on who you want to be able to use your form, a system flow like:
Do you accept our privacy policy? (Click 'yes'/'no)
What is your full name? (Click 'ok')
Would you like to register? (Click 'yes'/no')
You wouldn't have to refresh the page after each question, but if you gave users some idea of how close they are to being finished the form, an individual question approach might be less intimidating and more accessible for your users.
Finally, be proud of yourself for being concerned with accessibility! Best of luck!
i think better if you can post screenshot of that form. from my experience you can tryout some of the steps
1. Keep only fields which you need for uyour system rest take out.
2. Divide into different section
3. if needed can have accordion kind of panels
4. please have proper feedback system, better if you can prompt feedback while filling the form itself instead of waiting for submit or finish button.
5. from the visual, great to have white/gray kind of interface
6. have proper instruction for fields if needed
7. button with affordance
artsrajesh
You need to check out the information on this guys site. Most amazing I have seen anywhere on the net
http://www.lukew.com/presos/
there are many videos, pdf's, power points on form best practices
here is a good start on the site.
http://www.lukew.com/resources/articles/EventApart_WebForms_120809.pdf
and here
http://www.lukew.com/resources/articles/web_forms.html

How to get started on a diet logging script in php/mysql/jquery

Hey guys, hope this isn't too much of a n00b question
I'm mainly a front end developer that has recently started to do some back end programming. The script I'm working on is pretty simple (in theory). I just don't know where to begin and was hoping for some advice that will lead me in the right direction.
-The script is essentially a simple data logger.
-Everyday the user logs into the website, where it brings them to a single page.
-The user then checks an input box and enters a value into another input box
-That number is stored in the database
That's pretty much it. It seems pretty simple, but the problem is that there needs to be one administrator account that can read all the inputs of all other users.
My Question:
What is the BEST way to start this project? I have absolutely no clue on how to start it. Should I create classes for each of the functions (user logging in, user inputting value)? Should I use a framework? What would be the first steps you would take as a programmer.
I know this isn't a specific question, but like I said, I'm new to writing scripts that involve dealing with the backend and all that fun stuff. Thanks in advance.
In my experience - start with the front end. It's fantastic that you're a UI developer and you should absolutely start there. If a value should be dynamically inserted put in a placeholder.
At this stage I think a framework is inviting a pile of work to land on your desk. PHP documentation is great and will serve you better than any framework in my opinion.
Here's what I'd do, maybe you can roll with it too:
Create the UI in simple HTML/CSS/jQuery
Insert placeholders for dynamically created content
Remove common elements (header/footer/sidebar boxes/etc) and create PHP includes
Hunt down each "dynamic data" placeholder and create a PHP function to output placeholder data
Once you know what data you need, create the database
Create example records in the database
Adjust the PHP files to pull out example records
Now create the forms to insert data into the database (because you know what few fields are needed)
Test, test and test
I have always worked this way because I believe the user comes first. Many programmers are too involved in the architecture or database structure or complex forms. Most people at work hate me because I start with the UI. You sir are privileged!

Building a large form, need advice

I have to build a large form for users to fill out in order to apply for graduate study at the college I work for. There will be a large amount of information to collect (multiple addresses, personal information, business information, past school information, experience, etc...) and I want to know the best way to handle all this. I'm going to be using PHP and Javascript.
Are there any helpers or pieces of frameworks that I can use to help with the building/validation of the form, something I can just pop into my existing project?
Also would like any advice as far as keeping track of a large form and the resulting data.
You need to use multiple pages, and you need to include a mechanism whereby users can leave, and come back and fill out the rest of the form later (or if they're accidentally disconnected). Otherwise you're going to have all sorts of user issues, not due to your service, but because they're using computers and internet connections that are flaky, etc.
Survey software is probably a reasonable approximation of what you're doing, and there are survey packages for most PHP CMS's. Are you building this from scratch, or do you have an existing CMS underneath?
-Adam
A few tips, without knowing all the specifics of your form:
Don't show the user everything at once - this can be accomplished by multiple pages, or by selectively showing/hiding elements on the form as the user progresses through it. Provide contextual navigation that says "You're on step 3 of 10" so the user can get a sense of where they are in the form and how much effort is required to finish it.
Providing a mechanism to save and return later is a fantastic idea. If possible, provide a link to an email account of their choosing - you want to make this component as easy to use as possible, and requiring them to fill out an additional username/password to retrieve their data is just another barrier to completion.
Only ask for what you absolutely need. Yes, you're going to have to fight some political battles here - everyone wants as much as they can get. One way to combat this (especially effective when you have pressure from multiple groups) is to build out some prototypes: 1 with EVERYTHING and one with several sections reduced or removed. Have stakeholders from each group fill out both of them and measure their time to completion or roll-throughput yield. When you've got completion data, and they realize how much every other group is asking for (in addition to their group) they are easier to work with. In short, remove as much as possible - let the user go back later to provide more details if they wish.
Write down all your inputs on index cards and see how they logically fit together. More often than not you will find more efficient groupings or orderings. More than likely you will come up with much more usable ideas. This is extremely important when converting paper forms to online forms. Usability.gov has a fantastic case study on this topic.
A List Apart have an article on building sensible forms that is a good read
Why does the form need to be large on the first instance? Can't you trim it down to the bare essentials for the account and provide a way for them to come back later to flesh out the rest of the details?
For form validation, pop a gander on the jQuery validation plugin, Validation
Well I agree with Adam but I have some advise for you.
If I were you, I would create some virtual hidden tabs instaed of multiple forms with a next button.
You can create some which can control by javascript. First show the first one which will collect personal information like Name,Birthday,email, and etc... .
Once user filled them out and clicked on next button,hid this and show the other which will ask for other information like address and so on.
Once the whole dive compeleted, at the last div put a submit button which will submite the whole information to the server at once.
By why do so?
User will not get shocked becuase will not see a long form at each time and will fill out with patient.
You hit server at once;usually universtites and college's servers are too busy, you better design a form which hit the server least. This could count as performance tip.
Since you will submit the whole data at once, you would not worry about the issue that user will continue to fill out the other pages or not,so you will use less session which still will count as a performance tip.
This way makes your form more interesting and you can called you did something like Ajax.
You can add Javascript form validation to make it more user-friendly, but one thing you should never skimp on is the server-side validation... which has historically been awful in PHP.
One thing that'll make your life a million times easier here is the filter library, especially filter_input_array() since you can build the input validation programmatically instead of having to copy and paste a lot of checks. It takes some getting used to, but it's much, much better than the old way of doing things.

Categories