|
|
|
Home Credits Affliates Link Exchange HTMLshaman PHPshaman LINUXshaman Helpful Links Web Design Images Backgrounds Icon Sets GIF Images |
Language Intro : The Basics Lets start by making your first prototype PHP script and will be using Notepad for the editing. Open up Notepad and then enter the following into the text editing program. <?php print "I love Marshmellows"; ?> After that, save this file as "test.php" and also as "test.ophp" where the .php is the right extension name and the .ophp is the wrong extension name. Upload both and see what happens. The .php file streams properly printing the text "I love Marshmellows" but the one with the wrong extension was regarded as a normal text file by the WebServer and streams everything. So naming it right is very very important. Also to note is that even when you do a VIEW SOURCE from your web browser or even if you use a program like OFFLINE EXPLORER to rip or download the site, your php coding tays safe as the webserver will not allow it to be taken from the Port 80. When scripting it is always nice to ahve some comments so as to know where and what a specific line does. These comment however, do not appear when the user loads a webpage but only when you open up the php source file. // this is a comment # this is also a comment /* Anything withing the slash and star is a comment */ Nore that the first two will only be comments on the same line. After all this, you can produce your first functional php script with the addition of HTML. Refer to HTML Shaman for details on how to make HTML scripts if you don't already know. Below is an example of how your first script will look like <html> <head> <title>What do Shamans Like?</title> </head> <body> <br> <?php /* This Prints my thoughts about what Shamans like to eat */ print "We <b>love</b> Marshmellows"; ?> </body> </html> Note that I have also placed a HTML code into the enclosed php function, because you are using the " tag, it will print as a HTML code and making the letters "love" bold.
|
| Our Recommended Links |
|
|
Contact us at webmaster@galacnet.com for advertising opportunities on GalacNet. |