• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

PHP + mySQL + web hosting-age

  • Thread starter Deleted member 12837
  • Start date
Status
Not open for further replies.
D

Deleted member 12837

Unconfirmed Member
So I've recently been put in charge for the next year at least of maintaining a website for the selective living group I'm a part of at my university. Think of it as a fraternity for now since that's easier than me trying to explain exactly what "SLGs" are (they're unique to my school). We already have an existing site (that I plan on heavily modifying) but it's hosted on the university's webspace, which has an annoying URL and most importantly it doesn't allow PHP and I'm sure a collection of other useful stuff.

While I know a ton about HTML/CSS/Javascript and building the actual website itself, I have ZERO knowledge of servers, networking, hosting or PHP, MySQL, etc.

I would like to move the site to an external host and be able to give it a name of my choice (I'm thinking www.waynepals.org, don't ask). So I guess the first question is, what service should I use to do this, or should I set up my own server and host the website on that? If I'm better off using an already established service, obviously the cheaper the better as long as they still provide what I need. If I might want to host it myself, how would I go about doing that?

Looking a little bit ahead, here are some of the plans I have for the website:

- Have some password protected areas of the site
- Set up a database of alumni contact information that they can submit themselves (using forms I guess). I'd like this to be searchable by various fields like name, location, class year, etc.
- Set up a paypal donation system so alumni can donate money to the house/living group
- Have signups for freshman during rush (filling out contact info, submitting a picture, etc)

The above features are what I definitely want. Here are some other things that I may want to be able to implement in the future:

- Set up a message board/forum
- Be able to upload pictures, videos, or other files

Any help with ANY of this, whether its a website or book recommendation or just some tips from you pros out there, would be greatly appreciated, thanks.

edit: I should probably mention I'm running on OSX Tiger, if that matters
 
Look into getting xampp

Apache Friends Xampp - http://www.apachefriends.org/en/xampp.html

This will turn your computer into an apache web server, allowing you to test PHP and MySQL on your own machine before uploading to a website. If you use a wireless router, you'll need to route HTTP traffic to get this working.


Learning PHP / MySQL

Tizag Tutorials - http://www.tizag.com/

Good starter tutorials on PHP and MySQL there.

MySQL and PHP both have excellent manuals online. Whenever you're stuck with a particular problem or function, you can bet yourself anything that Google will turn up the answers from either manual.

If the MySQL queries you submit from PHP don't seem to be working, test them in PHPMyAdmin -- it outputs MySQL errors telling you whereabouts the error is occuring, if there is one. PHPMyAdmin comes with Xampp, and will also most likely be included in your web hosting package when you buy it.


A Log in System

Evolt - http://www.evolt.org/PHP-Login-System-with-Admin-Features

PHP Login System w/ Admin Features. If you really get into the PHP side of things, this can be a nice platform to give you a good kick start... for example, I took a lot of what was here, changed it so you log in with email rather than username (meaning people can share the same nickname / username), and added a whole bunch of other stuff... rating/voting on users, myspace style commenting etc

Alternatively you may want to look into a Content Management System (CMS). Often you can plumb these into forum software like phpBB or vBulletin, so that they share the same userbase. Other people will have to give you recommendations though I'm afraid.


Cool shit

Prototype - http://www.prototypejs.org/
Moo Tools - http://mootools.net/

When you want to add cool AJAX shit and various effects to your page(s), check one or both of these out
 
If you go the route of doing something in PHP from scratch as opposed to going with a CMS, power to you. Here's a few things I think you'll be wanting to think about.

User input can't be trusted

You should never let anything they enter be reflected in your database or on a subsequent page without processing and attempting to remove any malicious code first. This will save you some time in that regard...

InputFilter - http://www.phpclasses.org/browse/package/2189.html

When you know how to instantiate PHP classes (and the login system I posted earlier will help you get your head around it), you can use the functions of this class to cleanse user input. Documentation is at the link. As a warning, I'd say you probably can't rely on it all the time, there'll be some things you have to do manually, but its great being able to cleanse a string or entire array in a single line of your own code.

phpclasses.org is a good resource for all sorts of other different things as well. In future, you might wanna check out the directory to see if there's something that already does what you need to do etc.


Some common PHP functions

Eventually you're gonna want to make sure things that users submit conform to a certain criteria, form or syntax.

For example, think about the syntax of email addresses, phone numbers, post codes etc. Imagine times when you'll want alpha-numeric characters only, or numeric only. You'll want to check that certain things are of a certain string length. You might wanna make sure user input contains certain words or characters, you might want to perform a search and replace on what they've done.

ereg / eregi -- this is all about matching a string to a pattern. You can use this to validate email addresses and things like that. Very powerful, but also a pain in the arse. You're gonna need to learn regular expressions or find a regular expressions reference on the web (google is your friend). Some of them have a "cheat sheet" that you can print off and keep near the computer.

ereg/preg-replace -- this is for when you wanna search and replace certain strings or characters. Again very powerful. Potential uses can be changing XML, or converting messages (that are stored in BB-code style) to HTML.

strip_tags / htmlentities -- all about getting rid of HTML from user input

addslashes / stripslashes / mysql_real_escape_string -- all about escaping/unescaping reserved characters and quotes. Look into something called magic quotes when you get your webhost and try to asscertain whether they have it turned on or not. This stuff is important for avoiding MySQL injection attacks and things like that.

There are a TONNE of other functions you'll end up using on a regular basis for things like string manipulation, arrays, yadda yadda yadda. Like I said earlier, google is your friend, and the PHP / MySQL manuals are great... particularly the way they have a comment section at the bottom of every page. If you've done any Actionscript / Javascript before, you'll get into this quicker than you might think.
 

Prine

Banned
- Sessions for protected areas of the site are extremly easy to implement. You need to plan what areas are to be accessed by password/username. Read up on $SESSION variables and COOKIES

- PHP4,5 come with GD library for image manipulation, so its perfect for forcing image sizes when users upload thier image.

- Paypal have good tech doc that covers how to implement donations and general payment. You need a developer account before you begin. I assume your DB will be talking with PayPal on a regular basis, to track payment and user info. Paypal provide variables to you to mess around with depending on the status of payment

https://developer.paypal.com/

My advice is that you consider how you are going to handle your search. Be clever with pattern matching, to make it as accurate as possible you cant rely on descriptions and titles. Think about keywords and allow it to be edited by you or admin
 

dalyr95

Member
I use Dreamhost as my hosting company, many can offer assistance and prebuilt apps such as phpBB(message board) and search website functions/email functions, where all you need to do is click a button to get it set up. Look around, web hosting solutions, see something you can afford (I pay $50 a year, others can be cheaper)
 

borghe

Loves the Greater Toronto Area
www.w3schools.com
www.php.net
www.google.com

those are the three biggest tools you'll need. The fact that you have plenty of HTML/CSS knowledge is great... however you don't mention how much structured language programming experience you have. If you have none... umm.. I would seriously spend a ton of time going through just random pages and figuring out how they work. If you already have an ok amount of programming experience, well then php is easy and those top three links are all you'll need.
 

BTMash

Member
For CMSes you could possibly use, I would suggest trying out drupal (is that all that I respond with these days??) since a lot of those features might be available 'out of the box' (you will need to do a fair bit of php programming due to searching by certain user info), but its has a lot of very useful features (and it has user input cleansing as well :))
 
D

Deleted member 12837

Unconfirmed Member
radioheadrule83 said:
Look into getting xampp

Apache Friends Xampp - http://www.apachefriends.org/en/xampp.html

This will turn your computer into an apache web server, allowing you to test PHP and MySQL on your own machine before uploading to a website. If you use a wireless router, you'll need to route HTTP traffic to get this working.

Yeah I pretty much only use wireless, either with a router at home or the campus network. How do I route HTTP traffic?

radioheadrule83 said:
If you go the route of doing something in PHP from scratch as opposed to going with a CMS, power to you. Here's a few things I think you'll be wanting to think about.

CMS?

The only reason I suggested doing PHP from scratch is because a) I want to learn PHP eventually, so now's a good time, and b) I didn't know I had another option haha.

I'm open to using templates or tools that would facilitate with setting all of this up, but at the same time I don't want my hand held too much so that I can't go in and manually tweak things if I need to later. For instance, when writing HTML/CSS I would never want to use a WYSIWYG editor like Dreamweaver.

borghe said:
www.w3schools.com
www.php.net
www.google.com

those are the three biggest tools you'll need. The fact that you have plenty of HTML/CSS knowledge is great... however you don't mention how much structured language programming experience you have. If you have none... umm.. I would seriously spend a ton of time going through just random pages and figuring out how they work. If you already have an ok amount of programming experience, well then php is easy and those top three links are all you'll need.

In terms of structured language programming experience, I'm probably somewhere between intermediate and advanced in Java knowledge. That's about it though.
 

theBishop

Banned
404Ender said:
Looking a little bit ahead, here are some of the plans I have for the website:

- Have some password protected areas of the site
- Set up a database of alumni contact information that they can submit themselves (using forms I guess). I'd like this to be searchable by various fields like name, location, class year, etc.
- Set up a paypal donation system so alumni can donate money to the house/living group
- Have signups for freshman during rush (filling out contact info, submitting a picture, etc)

The above features are what I definitely want. Here are some other things that I may want to be able to implement in the future:

- Set up a message board/forum
- Be able to upload pictures, videos, or other files

Any help with ANY of this, whether its a website or book recommendation or just some tips from you pros out there, would be greatly appreciated, thanks.

You're going to find that PHP+MySQL completely changes the way you think about web design.

All your future requirements are doable and actually not all that difficult. I was able to teach myself basic SQL, PHP and implement a lot of those features within a couple weeks.
 
D

Deleted member 12837

Unconfirmed Member
Well, I think I managed to install the latest versions of PHP and mySQL. I couldn't get mySQL to work from the command line until I added the directory to the PATH though, but now it seems to be working ok.

Any way to test it out to make sure? I'm worried that I screwed something up fiddling around in the terminal and installing various packages. And is there an easier way to work with mySQL that isn't all command-line based? That stuff scares me haha...I did install the preference pane though so it's easy to start/stop the server and turn it on automatically at startup or not.

Do I need to worry about setting up any sort of security/passwords?
 
D

Deleted member 12837

Unconfirmed Member
edit: nvm, fixed that strange problem...keep the posts coming though :D !
 
D

Deleted member 12837

Unconfirmed Member
So is there any reason I shouldn't use a CMS for my purposes with this website? How much harder would it be to do it from scratch? Do most people use a CMS, and are they complicated to implement?
 
Like anything, you want to use the right tool for the job. If your site is a very brochure style, content driven site used to display articles and content, yeah, get your hands on Drupal or Joomla and you're going to be golden.

However, something like CakePHP is if you need a custom solution and building blocks to use in the future for even more custom stuff.

I built a full content based site in Joomla in 2 days, but if it needed lots of cool customizations, application-like work going on, user admin stuff, I would have used CakePHP. See where this is going?
 
D

Deleted member 12837

Unconfirmed Member
JasoNsider said:
Like anything, you want to use the right tool for the job. If your site is a very brochure style, content driven site used to display articles and content, yeah, get your hands on Drupal or Joomla and you're going to be golden.

However, something like CakePHP is if you need a custom solution and building blocks to use in the future for even more custom stuff.

I built a full content based site in Joomla in 2 days, but if it needed lots of cool customizations, application-like work going on, user admin stuff, I would have used CakePHP. See where this is going?

Ah ok, yeah I understand thanks. Besides the alumni database and some password-protected file uploads, the site will mostly be static content/information about the group. During Rush in the fall it will have more sign-ups for a separate database than the alumni one, but it would be a similar sort of system.

As much as I would love to play around and add cool custom features, they would ultimately be unnecessary for this particular site, so it sounds like Joomla or Drupal is the way to go?
 
Joomla ->
-"site in a box" type of CMS. Very easy for the end user.
-poor user management currently.
-Content articles, managing a site map are the specialty of this package.
-Personally dislike the package as a developer. See Cake for why.
-Upgrading commit sepuku

Drupal ->
-CMS similar to Joomla, but better user management stuff (ACL)
-Harder to learn as a developer, more flexible once you start moving.
-Personally feel I would take it over joomla.

CakePHP ->
-Robust framework.
-Basically abstracts and helps you do things that would normally be a pain like all sorts of database things, managing lists, etc.
-Incredibly re-useable code.
-Upgrading has an amazing design (relative to other options)
-Learning it now, but makes other php-mysql frameworks and CMSs like shite in comparison thus far.
 

BTMash

Member
JasoNsider said:
Like anything, you want to use the right tool for the job. If your site is a very brochure style, content driven site used to display articles and content, yeah, get your hands on Drupal or Joomla and you're going to be golden.

However, something like CakePHP is if you need a custom solution and building blocks to use in the future for even more custom stuff.

I built a full content based site in Joomla in 2 days, but if it needed lots of cool customizations, application-like work going on, user admin stuff, I would have used CakePHP. See where this is going?

I'd like so say that in defense of drupal, it def. can be used as a custom solution (see http://drupal.org/project/modules) and for more than just a brochure style site (Onion, TWiT, most of SonyBMG and Warner's new sites are built using Drupal). A couple of years ago, it was compared to lego blocks :)
 
Status
Not open for further replies.
Top Bottom