Networking North Dakota Here Service Your Computer Here
AmegA Design - You Be Creative - We will help you create it! Computers For Kids North Dakota
AmegA Web Design, & Bulk Ink Systems
New and Used Computers and equipment in North Dakota Tutoring for Windows based PC's
AmegA News Letter and Information STOP BUYING EXPENSIVE INK CARTRIDGES!
Streaming Internet Communication is the Future  
  Streaming Internet Communication is the Future
 
Streaming Internet Communication is the Future

Thank You Web Monkey
http://www.webmonkey.com
I Have made a copy of these how to dues because of the awesome direction it gives for php learning

Web Monkey PHP

 


PHP
By Web Monkey

Page 4 — Your First Script

--------------------------------------------------------------------------------

You'll be glad to know that the really tricky stuff is behind you. Installation of software is always a black hole because so much changes from system to system. But with any luck your database is up and running, and PHP is compiled and installed with our Web server and able to recognize documents with .php3 extensions.

Let's dive right in and write our first script. Create a text file containing the following:

<html>

<body>

<?php

$myvar = "Hello World";

echo $myvar;

?>

</body>

</html>


Now call up the URL, for instance, http://myserver/test.php3. You should see a page containing the text "Hello World." If you get an error message, check the PHP documentation to see if you set things up properly.

That's it! That's your first PHP script. If you view the HTML source for the page, you'll see that there is only the text. Hello World

That's because the PHP engine has examined the page, processed any code blocks that it found, and returned only HTML.

The first thing you'll notice about the script above are the delimiters. These are the lines that start <?php. This indicates the start of a block of PHP code, and ?> indicates the end of the block. The power of PHP is that these can be placed anywhere - and I mean anywhere - in your code in any number of ways. Later we'll see some interesting uses for these, but for now let's keep it simple. If you wish, you can also configure PHP to use short tags, <?, and ?>, but these are not XML compliant, so be careful. If you're making the switch from ASP, you can even configure PHP to use the <% and %> delimiters.

Another thing you'll notice is the semicolon on the end of each line. These are known as separators and serve to distinguish one set of instructions from another. It is feasible to write an entire PHP script on one line and separate the portions with semicolons. But that would be a mess, so we'll add a new line after each semicolon. Just remember that each line must end in a semicolon.

Finally, you see that the word myvar begins with a dollar sign. This symbol tells PHP that this is a variable. We assigned the words "Hello World" to the variable $myvar. A variable can also contain numbers or an array. Either way, all variables start with the dollar sign symbol.

The real power of PHP comes from its functions. These are basically processing instructions. If you add up all of the optional add-ins to PHP, there are more than 700 functions available. So there's quite a bit you can do.

Now let's add some MySQL to the picture.

next page»


  Streaming Internet Communication is the Future
  Streaming Internet Communication is the Future
 
Streaming Internet Communication is the Future

Thank You Web Monkey
http://www.webmonkey.com
I Have made a copy of these how to dues because of the awesome direction it gives for php learning

Web Monkey PHP

 



AmegA Home 1910 E Front Ave Bismarck, ND

1910 E Front Ave - Bismarck, ND
701-223-9694
HOME * NETWORKING * SERVICE * SALES * TUTORING * WEB DESIGN * COMPUTERS FOR KIDS * NEWSLETTER * CONTINUOUS INK MACHINE SYSTEM * VIDEO EMAIL * CONTACT US HERE
Would You Like To Hear Some Silly Commercials That AmegA Has Placed On Some Cool Radio Stations Here
Bill Straily& Scott MC Gowen At Cumulus - Jason Huber & The B Man at Clear Channel
Commercials
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17