flash animation video tutorials

 

 

 

.

.

.

 
Web video-animation.com

.

Elena Tresh Foundation Florida

.

flash tutorials flash tutorials flash tutorials flash tutorials

Beginning PHP Programming

by Ron.
Hello everyone!
I'm not pro at PHP, but I can give you the basics, and believe you me, the basics are still useful! You can do so many cool things with PHP. You could make forums, polls, chats, calendars, calculate stuff, store stuff into templates and much more. If you have PHP enabled on your server preferable PHP version 4 or 5 then you can use this tutorial.

Get an account on FreePGS.com, and ask for a free upgrade to basic plus. It's completely free. Remember PHP only works if your extension is .php or .php1 .php2 ... .php5.
Ever wonder what all that junk was when you clicked on a link? Such as... email.php?name=Ron&email=goonstk@yahoo.com
Most people have. Well, that's PHP. In PHP tags start with
Something basic you can do is print out text.
First Open up your text editor.
Type the following in:

 

<?php 
echo "Hello World!"; 
?> 
 

That will print out the words Hello World! That isn't useful, but we're still on the basics. It uses the echo command to print those words and ends the command with a colon. That could also be accomplished by using print instead of echo. Code:

<?php 
print "Hello World!"; 
?> 
 

We used the same technique with the quotations with only a different word. Echo and print commands are basically the same thing.
Instead of text lets define a variable and call that variable with echo. Variables always start with the dollar sign $.

<?php 
$message = "Hello World!"; 
echo "$message"; 
?> 
 

Notice that we put $message into quotations, and it printed out Hello World! See this is a cool thing about PHP. A variable can be displayed in quotes or without quotes and still work. With other scripting languages such as Macromedia's Action Script you would need to take it out of the quotes. You could do it that way too. Lets see what it will look like if we attached a couple variables with text.

<?php 
$message = "great"; 
echo "I feel " . $message . " today!"; 
?> 
 
That would be longer then just putting in...
<?php 
$message = "great"; 
echo "I feel $message today!"; 
?> 
 

Am I right? Oh and you can also put HTML tags in the echo commands. But if you use echo with the quotations then that might mess things up. There are things called escape commands. Such as if you wanted to put in a quotation without messing up the PHP script, then just put a backslash before it like...

<?php 
echo "I have \$53,000 dollars in my bank account.<"; 
?> 
 

Did you see how it was used? We had to escape the dollar sign so that the script wouldn't think that 53,000 was a variable and the html quotation marks.

Now lets have some fun. Lets say you wanted to add another link to your nav. And you had 50 pages with that nav in plain HTML code. That would really stink, because you would have to change each of those files. You can make it much easier if you just broke up your pages intro structures. And stored those structures into template files. That means you change nav.tpl it would change your whole website's nav with that one file. To do that, make call your structures:

header.tpl 
nav.tpl 
body.tpl 
footer.tpl 
The header could contain your title, logo, ads, CSS, etc..
The nav would contain links, buttons, whatever.
The body could contain blog, news, email, etc.
The footer could contain copyright, etc..

Here's the code that could fix that problem of changing one thing.

<?php include header.tpl ?> 
</td> 
</tr> 
<tr> 
<td> 
<table> 
<tr> 
<td> 
<?php include nav.tpl ?> 
</td> 
<td> 
<?php include body.tpl ?> 
</td> 
</tr> 
</table> 
<?php include footer.tpl ?> 
 

That would be very nicely constructed.
Now back to all that junk that comes out in some pages.
email.php?name=Ron&email=goonstk@yahoo.com
Those are PHP variables. Here's how to make something like that without making 500 pages.
Make a page and call it index.php


<?php 
    if ($_GET['v'] == '') { 
        include home.tpl; 
    } 
    if ($_GET['v'] == '1') { 
        include games.tpl; 
    } 
    if ($_GET['v'] == '2') { 
        include toons.tpl; 
    } 
    if ($_GET['v'] == '3') { 
        include jokes.tpl; 
    } 
?> 
 

That code means if you go to index.php then the code will open the home.tpl file.
If you go to index.php?v=1 then it will open the games.tpl file.
If you go to index.php?v=2 then it will open the toons.tpl file.
And so on. Cool huh? That means you could make an unlimited amount of pages, to display an infinite amount of data, with very little space used on your server!

I would say that that is pretty sweet. I hope you learned something!
Here are some links for some PHP help, scripts, and tutorials.


PHP.net - The king of PHP information!
PHP Freaks - Tutorials, forum, and cool stuff
Hot Scripts - Plenty of PHP scripts to download
Kirupa.com - Great stuff in PHP. Also has mix tutorials with Flash and PHP!

Well you're finally done! All you have to do now is try out some PHP on FreePGS.com and I bet you'll love it. You can find books on PHP for about $25.00 at your local book store (Ex. Barnes and Nobles, Borders, etc).

~RON
EDITs...
----------------------------------
09/28/04 Add URLs.
09/25/04 Fixed escape commands. Sorry.

flash 8
.