How to create a user generated website?
January 24, 2012 7:00 PM   Subscribe

How do you create a user generated website such as metafilter?

(something on a smaller scale than metafilter)

Help point me in the right direction in where to learn this online, and best current practices...

What front end programming knowledge do you need to know, and what is the best software?
(how to display the webpage from a database, and allow user to create input into the db from a webpage)
(how to create secure sign on)

What back end database software is most commonly used?

I currently am strong on the db end, and know how to use MS Access / Excel / SAS / other , how can I link this knowledge into creating basic webpages from db content, and allow user to input data into db from the webpage?
posted by MechEng to Computers & Internet (22 answers total) 6 users marked this as a favorite
 
You need to learn about Content Management Systems.

Having done so, you need to ask a more specific question. There is a big difference between a community weblog and, say, YouTube.
posted by LogicalDash at 7:04 PM on January 24, 2012


I agree with LogicalDash; need more info. What's the goal? How many users are you expecting? What's the site activity? Functionality? Good answers good be anything from open source stuff like WordPress or Elgg, or whatever to a custom-built platform, depending upon what you're thinking.
posted by smirkette at 7:07 PM on January 24, 2012


Response by poster: looking for more of a text based community, such as craigslist and metafilter... etc.. (if that helps)
posted by MechEng at 7:07 PM on January 24, 2012


Not really. craigslist and metafilter are very different sites, requiring very different software. StackOverflow is also text based, and it's different again.
posted by jacalata at 7:10 PM on January 24, 2012 [1 favorite]


For something like MetaFilter you're probably looking for forum software. From Wikipedia, "Comparison of Internet forum software".
posted by XMLicious at 7:13 PM on January 24, 2012


Response by poster: The forum software, CMS stuff is good, but I would like to learn to do this sort of thing myself, if I knew how to use MS Access, is it possible / how do I create several webpages from this static information db? How do I create a user input sheet (website) that allows them to input data into the db, which would then creates a new webpage...

(ignore all of the confusing user sign in stuff for now, and teach me what basic language i could do this in)

If it's not possible with access, what other program might you suggest?
posted by MechEng at 7:36 PM on January 24, 2012


Don't use MS Access. Learn MySQL (first link in google, no recommendation). First you'll have to learn php, html and javascript and css would also be useful.

To rephrase your question, it sounds like you're not trying to create a site in particular, you just want to learn how to build a website that runs with a database backend and allows users to input content. I created a gift registry for my sister that allowed her to upload pictures and descriptions of the desired gift, and then allowed guests to comment on each item and say that they had already bought it, or wanted to buy it with someone, etc. Does that sound like the kind of thing you'd like to achieve?
posted by jacalata at 7:46 PM on January 24, 2012 [1 favorite]


The most important thing is patience. It took Matt two years to reach his first thousand registered users. (IIRC)
posted by Chocolate Pickle at 7:53 PM on January 24, 2012


Response by poster: jacalata: the rephrased question is exactly what I'm looking for... how to code a basic website from a database... (any learning material is welcome here , from beginner through intermediate)

chocolate pickle : im not looking to start a major community anytime soon... just something between close friends for the mean time... and develop some new skills / learn to play with making basic dynamic webpages based on simple text user content...
posted by MechEng at 8:02 PM on January 24, 2012


If you want to learn how to program this kind of site from scratch, there are tons of web programming questions on AskMe that cover "What language should I use?" "What database?" etc. Try searching those, they offer a wealth of information. Here is a recent thread.
posted by baniak at 8:05 PM on January 24, 2012


My recommendations: learn PHP and MySql. They're the workhorses of the internet.

In a nutshell, the parts you need are:

1. Code that reads data from the database and outputs formatted HTML.

2. Code that allows users to log in and allows people to create new users.

3. Code that allows users to save data to the database.

Error-catching is probably the most important part of this. For example, if somehow there's a loophole which lets one user edit the user information of another, that's a problem. If users can create content without being logged in, that's a problem. If a user fails to enter a password when signing up, does that crash or does it warn them? What if the user creates content with a malicious javascript inside it? What if your MySql is not sanitized and lets malicious code read everyone's passwords? Most of the code you write will be to plug up these holes.

So, the basics is -- learn PHP, MySQL, and learn to read from and write to databases. The rest is either formatting, plugging security holes, or handling errors.
posted by AzraelBrown at 8:06 PM on January 24, 2012 [3 favorites]


Sounds like OP is more familiar with the Microsfot stack. Using ASP.net on a windows server, you can actually power a small website out of an Access DB, but it won't be long before you need to move to a real database. If you're more familiar with the MS environment and want to learn the basic concepts without having to worry too much about LAMP (linux, apache, mysql,php), I would start with Microsoft technologies and later worry about what's more adequate for each situation.
posted by falameufilho at 8:46 PM on January 24, 2012


And to spin off from AzraelBrown's response back to the earlier stuff about using a CMS; I've worked with a CMS precisely to avoid having to program all that stuff from scratch, and because if I tried, I'd miss something important. I could still heavily customize it with template files written in PHP, but I could count on the pre-existing user registration and security functions.
posted by RobotHero at 8:49 PM on January 24, 2012


One term you're looking for might be CRUD.
posted by rokusan at 12:34 AM on January 25, 2012


OP. Knowing MS Access and Excel does not make you "strong on the db end". To a first approximation, nobody uses Access or Excel as the back end for a web service. They use a storage library appropriate to their needs or a general purpose SQL database (MySQL, SQL Server, PostgreSQL, Oracle etc etc) with an appropriate data representation.

The front end is usually written in Javascript / HTML / CSS these days (ie, in the browser), whilst the middle-ware that connects the two can be written in almost anything. Java, Perl, PHP (although right-minded programmers turn their noses up at it, there's a lot of code out there in PHP), Ruby (usually with the Rails framework). Plenty of C# out there too.

But if you don't know any of these, you're much better off with an off-the-shelf solution. Even if you *do* know enough to program the full stack yourself you're still probably better off just using an off-the-shelf solution!
posted by pharm at 1:00 AM on January 25, 2012 [2 favorites]


Another term to know is LAMP (and related).


(Don't forget Python on the backend. Django's a popular framework; there's a good tutorial, though it's not the most beginner friendly.)
(Some crazy kids also use Javascript on the backend with node.js)
posted by fragmede at 1:46 AM on January 25, 2012


Hee. I love watching techie types answer techie questions, because so so many of us fall prey to the same assumption: that the person asking the question is of the same level of knowledge as we are. Example: RobotHero (not picking on you, honest!) making the very valid point that when building a site, there is no sense reinventing the wheel when you can start with a CMS and build from there - and then goes on to make the point that he could customize it with template files written in PHP - forgetting that in order to do that, you still have to learn PHP first, which is the point he seemed to be trying to refute when he started. And tons of other people talking about things like distinctions between different types of software - when as far as I can tell, you're still working on the basic question of "where do I start?" and nowhere near the question of "where am I going?" We all do this, every time, and it really is hilarious purely because it is so incredibly universal. :)

So I'm going to try to pick out the parts that I think are particularly relevant to you as a beginner - not trying to diss anyone's opinion in the least, only to clarify things that might be more or less important from this particular standpoint.

While falameufilho makes a valid point about sticking with what you already know, you seem to be asking "what is the standard" - and there really is no one standard in these things, but LAMP (Linux/Apache/MySQL/PHP) is pretty much universal. As stated: the software is free, it's fairly easy to learn, there's a lot of solid documentation available (php.net is your BESTEST friend) - and since in my experience webhosting companies find Linux servers to be far cheaper to maintain, obtaining cheap webhosting with great perks on a Linux server is MUCH easier. And since so many people learn it, a lot of companies have adopted it - because it means that they can hire adequate in-house developers much more cheaply. (Or hire inadequate developers and use them interchangeably. Or outsource stuff to someone's 15-year-old brother under the table.) And again, for the same set of reasons, there are a TON of open source products qualifiable as "frameworks" upon which to build... and so on, and so forth. Overall, I would say without hesitation that PHP is probably the best entry point for any beginner - and while you may go on from there to different languages, you can also do a whole heckuva lot with LAMP and Javascript/HTML/CSS without ever going further. Some people build a career on it. And some people go "ewww" and immediately jump ship for Java or Python or *shudder* Perl. Your mileage may vary.

If you get a webhosting account, you won't have to worry about the Linux/Apache side of the system so much - you'll have some sort of graphic web interface for basic website management stuff, and can focus solely on the PHP/SQL part. If you decide to work on this on your local box, you can run something like XAMPP as a local webserver, without making it accessible to the internet. Some people will say that you should have a local webserver setup as a production environment - but as your personal computer setup will differ from the webserver, you could end up with a whole lot of weirdness when it comes time to make files live on the webserver. I generally code in a text editor, then upload it to the server to test. (Or code directly on the server in vi, because I am Geek Like That.) In terms of actual software, I would recommend coding in notepad++, or some other text editor - nothing fancier or more complex; you don't need it, and in fact will do better without it, at least to begin with.

There used to be this tutorial - very basic, very simple, maybe a page long, but in that one page it outlined the basics of a PHP/MySQL interactive site (connect to database, get data, insert data, modify data, etc.) simply enough for the newbiest of newbs to look at it, say, "Oh!" and immediately sit down and start doing cool stuff. Sadly, I now cannot find that page. I'll keep looking - or maybe try to recreate it if I can't find it, I dunno. Either way, there are a ton of similar tutorials out there - and php.net is, as I said, your BESTEST friend. Not only is the documentation itself awesome - but there is a TON of user-contributed material in the comments, from useful code snippets to warnings about little-known bugs and quirks to be alert for.

As far as "best practices" go... Security. Security security security. Learn everything you can, and then learn some more. Repeat to yourself one thousand times: PARANOIA IS GOOD. And then go study some more. Never trust user input, or any input that could be forged, e.g. any input at all; sanitize EVERYTHING. Never think in terms of what sort of user input should be filtered or excluded - start by excluding ALL input, then define only what you wish to allow. Encryption for passwords, never plaintext: a web developer should NEVER have the ability to find out what a user's password is. (Side note to non-techs: When registering with a new website, always use a neutral password - then, try out the "Forgot Password" link. If the website tells you via email or on their web page what your neutral password is, instead of giving you a link to reset it? Delete your membership and never go back: they are not handling your data securely, and should not be trusted to do so.) Error-checking and more error-checking and email alerts in case something really egregious happens. More paranoia. More study. And so on.

On your overall list of Top Ten Priorities, I would estimate that Security weighs in at numbers 1-5, 7, 9 and possibly 10. At the very least. The same flexibility that makes it possible to easily do awesome things with PHP also makes it possible to easily do really, really stupid things with PHP, so this is something you need to be aware of from the very start. Having said that... you'd be hard pressed to find a tutorial that DOESN'T make this very clear, so it shouldn't be an issue.

Meanwhile: once you've gotten some experience with the basics and become comfortable with the syntax, you'll start getting ambitious - and then, yes, you will want to start messing around with some kind of CMS or framework, for the simple reason that it is HARD to keep up with all the security exploits and necessary precautions, and writing and testing code takes time, and seriously, why should you bother if you can skip past all that and get to the part you really want to work on? However, it's still vital that you be familiar with basic HTML - and not get so wedded to any one framework that you can't adapt to another, so learning the basics is still a must.

It also makes a difference which framework you work with. The larger frameworks and CMSs are incredibly complex, definitely more so than I'd advise for a new coder. Some people swear by Wordpress - which is a fantastic lightweight CMS solution, and way more flexible than most people know - but in my experience, the documentation is sketchy, and often not easy to find. I have a personal fondness for SimpleMachines, but that is probably because I've been working with the codebase since it was first ported to PHP and know it better than most of my own code; it's a mature, solid product, but the documentation is all but nonexistent, and the quality of user-submitted mods varies wildly. Hopefully someone else will have a better suggestion for a good "starting CMS", in terms of clarity of code and availability of documentation.

And as RobotHero said, in terms of making your site distinctive, the major concern will be customization of template files, probably using PHP, CSS, HTML, Javascript. See, people tend to think in terms of software representing a definite product - Wordpress is a blog, SimpleMachines is a forum - but really, it is all just data being stored in a database and then retrieved and displayed in a particular format. Wordpress can be a plain ol' website, or a shopping cart, or a promotional contest site, or a lightweight personnel/project management system with separate levels of authentication and distinct personnel teams, or an x-rated webcam site, or used purely for authentication before hooking into something else entirely. Et cetera.

Anyway, that's my best recommendation; your mileage may vary. Have fun!
posted by mie at 2:07 AM on January 25, 2012 [6 favorites]


Oh yeah, as for that hilarity thing? I totally assumed that you already have a decent level of HTML knowledge. If you don't? LEARN THAT FIRST. You are going nowhere without HTML. And learn it in a text editor, not some graphic interface.

As for the PHP hate, I can say only that PHP is to languages what World of Warcraft is to MMORPGs: everyone sneers at it - and their reasons for doing so are entirely valid - but it is still an excellent gateway for beginners, and a whole lot of fun. :)
posted by mie at 2:19 AM on January 25, 2012


If you want a community website, choose an open source CMS thats close to what you want then hack at it until it does what you want. This is an easy way to get a site up quickly and learn the technologies involved.
posted by seanyboy at 3:01 AM on January 25, 2012 [1 favorite]


Btw. Microsoft webmatrix may be a good tool for you to get your feet wet with. There are tutorials on creating a blog with this. A blog isn't that far away from metafilter.
posted by seanyboy at 3:08 AM on January 25, 2012


Learn to build a site in PHP/MySQL, then build one, then throw it away and use an established CMS (or open source your code and see if others can help you turn it into something great). This way you gain the knowledge you want, but will have a shot at running a secure, workable site.

Drupal, PHPBB, and all the others have had thousands of people combing through and improving their code over the course of years, and still have occasional security problems (often thanks to other tools they rely on). They are widely adopted not just because using them is easier than coding your own, but also because they're more hacker-proof than anything you're likely to code as a learning project.
posted by coolguymichael at 7:45 AM on January 25, 2012


mie: I know you're not picking on me, but you made me want to clarify a point. "Knowing" PHP or HTML isn't all-or-nothing. I know enough to be able to customize an existing CMS without being confident that I could build one from scratch.
posted by RobotHero at 8:21 AM on January 25, 2012


« Older Lightweight project managment   |   Is self-hypnosis a valid therapeutic technique? Newer »
This thread is closed to new comments.