The answer to most of your questions is
PHP.
PHP allows us to do pretty much anything, from sending emails from our server right through to maintaining a back-end database containing peoples usernames and passwords.
PHP must be set up on your server, and then all of your pages must include PHP code to access the database.
I can provide more information on PHP works if you like...
http://www.php.netHere is a speel I wrote up awhile ago... i don't know if you already know this... it was written for someone who was learning PHP.
snYpir's PHP Quick Start GuideTo code PHP you need the following:
* FTP program and access to the backend of the site
* A good text editor (i recommend textpad -
www.textpad.com with the PHP4 syntax definition file)
* MySQL control center, available at
http://www.mysql.com/downloads/mysqlcc.htmlOk, so you should understand what HTML does. HTML pages sit on the server, and when a browser loads that page the various html tags cause the browser to display certain things. A HTML page, in it's own right, is not dynamic at all. It just sits there, and must be manually updated.
A HTML page that has embedded PHP however, is considered dynamic, because PHP will take information from the *database name* database and enter it into the HTML page returned to the browser.
HTML and PHP are intertwined - PHP is embedded in HTML. You'll see on the site that we only use PHP pages. When your browser loads a PHP page, the PHP agent on the server will automatically process the page, returning to the browser a page that appears to be HTML - the agent automatically processes the embedded PHP and the browser doesn't know that there ever was PHP in the page.
Suppose you have a HTML page:
<html>
Hi there
</html>
Embedded PHP looks like this:
<html>
<?php echo "Hi there" ?>
</html>
PHP code goes within the <?php and ?> tags. This code is C syntax, but is much more forgiving. It can span multiple lines of course:
<html>
<?php
echo "Hi there<br>";
echo "my name is ya mum";
?>
</html>
but obviously you need the end of line delimiter (
.
Now the real reason why PHP is so damn cool is because it can access information in a database, rip it out, and convert it to HTML.
If you look at the *ofpec* database in mysqlcc, you'll see it is made up of a heap of tables. Click on tResource. You'll see all of the fields in tResource on the right. tResource contains all of the information on ed depot resources.
Here is where SQL comes in. SQL allows us to search that database. We can call SQL through PHP. It is probaly worth learning simple SQL before progressing - and u can do that by hitting the SQL button in mysqlcc. Make sure you only do select statements!
try:
SELECT Name,ID FROM tResource WHERE Deleted='1' ORDER BY Name
mysql will list the names and IDs of all of the entries in tResource where Delete equals 1. To do this in PHP we would do:
<html>
<?php
$request = mysql_query("SELECT Name,ID FROM tResource WHERE Deleted='1' ORDER BY Name");
while ($aRow = mysql_fetch_assoc($request))
{
echo $aRow['Name']."<br>";
}
?>
</html>
Anything starting with $ is a variable. mysql_query executes the string in the brackets as a SQL query, and the result goes into $request (could be any variable name). Ok, when we did the query in mysqlcc, it returned every row, right? Obviously PHP can't return every every row and value in one hit.
We use mysql_fetch_row or mysql_fetch_assoc to return a single row of the result as an array. mysql_fetch_row returns an array that can be indexed as $aRow[0], $aRow[1] etc. mysql_fetch_assoc returns an array that can be indexed by the column name, ie in this case Name or ID, allowing for $aRow['Name'] or $aRow['ID'].
So, $aRow (could be any variable name) is an array representing one row of the result. The while statement simply loops through all results, a row at a time.
echo $aRow['Name']."<br>"; prints to the standard output (ie the final HTML page) the value of $aRow['Name'] and a <br> (newline).
What I have just described is the basis of all PHP - accessing a database via mysql_query and then outputting the results.
Please, be very careful in mysqlcc. you can delete EVERYTHING very, very easily. I recommend making your own table and then playing with SQL in that. (in *database name* right click on tables and select new table. click on the new table when it appears, and make sure it is highlighted for the entire time you are using it).
The best resources are:
http://www.php.nethttp://www.mysql.comBut I am sure there are other PHP/SQL tutorials on the web. Ok, good luck!