Hello again!
Here is my suggestion for your project: use PHP in conjunction with a
mySQL database to store scores, email addresses, and any other
information you require. You can use PHP to create dynamic forms
(such as email) and to interface with the database.
PHP is a server-side scripting language. Server-side means that the
document is interpreted by the web-server before it is sent to a web
browser. A user trying to view source of a PHP document will see
only HTML, because all the PHP code will have been replaced with
meaningful text by the server. An example of client-side
interpretation would be JavaScript, since the users browser must do
the grunt work. PHP is in the C/C++ family of languages, so if you
are familiar with any such languages (Java, JavaScript, etc.) you
should be fine. The other primary alternative for a server-side
scripting language is ASP--which is based on the Visual Basic language
family. Essentially, both ASP and PHP can accomplish the same thing;
its simply a matter of availability and personal preference. I myself
choose PHP because I am more comfortable with the C language family.
The other interesting thing about PHP is that the syntax is nearly
identical to that of PERL--a language often used in CGI scripting
(such as in shopping carts, although those can also be done in PHP).
The only real difference between PHP and PERL is that the former is
server-side while the latter is client-side. (Client side has the
advantage of versatility among user platforms and ease of use with
databases). The downside is that PHP must be supported by your
web-server (it is widely supported, though).
A database is essentially a large table (several tables if you need
them) in which you can store integers, strings, or large text bodies.
The easiest database to interface using PHP is the mySQL database--a
popular open source project. PHP has built-in functions for making
calls to a mySQL database, so it is a logical choice. Database
commands are made using SQL (Structured Query Language), although
really this is not a language. SQL commands are intuitive methods of
creating, inserting, deleting, and reading from a database table. The
inherent PHP commands allow you to send SQL commands to the mySQL
database (these names can be confusing at first: SQL is the language,
mySQL is the database). The advantage of using the database in your
instance would be that you could store a users alias, email address,
and high score (for example) as a row in a table containing all
players. You could then publish a web page with the top ten players,
send an email to all players, or compute statistics on the scores--all
from the same database!
Now you need to learn how to use some of these wonderful tools. There
are several good tutorials on the web:
#1 - PHP
PHP Builder has a good introduction to the basic features of the
language, as well as some of the more advanced techniques. You should
not need to read much more than the first two roman numerals to get
then hang of things.
http://www.phpbuilder.com/manual/
PHP.net also provides a good tutorial for newcomers to the language.
http://www.php.net/manual/en/tutorial.php
All you really need at first is a basic feel for the syntax and form
of the language.
#2 - SQL
SQL is extremely easy to learn. This W3 schools tutorial has
everything youll need to know about SQL (well, almost). For your
immediate purposes, you should be fine with just reading the SQL
Basics section; the advanced features are nice, but not required for
a successful database-driven site.
http://www.w3schools.com/sql/default.asp
#3 - Build Your Site with PHP and a mySQL database
This is a very excellent tutorial. It walks you through some basic
PHP and SQL commands, but it gives very good examples on how to use
the two together in a web-site.
http://www.mysql.com/articles/ddws/index.html
With even just knowledge of PHP and SQL basics, you will be able to
perform powerful tasks with a greater ease that would be possible with
HTML and a client-side language. The tutorials provide plenty of
examples that you should not have any trouble getting started. Once
you have the syntax down, you can also find all kinds of code snippets
from other PHP developers that you can use.
Here are some snippets to perform the task of sending an email using
PHP:
Sends an email with an attachment
http://codewalkers.com/seecode/98.html
A good walkthrough of setting up a form with a PHP script to process
and send an email
http://www.webreference.com/programming/php/phpemail/
If you are still interested in using JavaScript to send email, there
are 16 scripts available from this page
http://www.hotscripts.com/JavaScript/Scripts_and_Programs/Email_Scripts/
I hope this helps you with your endeavors. Below I have provided some
additional links for your reference or to help you find code snippets.
Good luck!
xargon-ga
Additional Links:
Two good references for commands:
http://www.phpbuilder.com
http://www.php.net
Good places to find scripts:
http://www.hotscripts.com/PHP/Scripts_and_Programs/
http://php.resourceindex.com/
http://www.php-scripts.com/
http://www.free-scripts.net/ |