Guest xaff Posted June 11, 2003 Report Share Posted June 11, 2003 Basic PHP tutorial I decided to make a short introduciton to PHP, I might write more tutorials if anybody would like me to. What is PHP? PHP is a scripting language, used to create dynamic webpages and retrive information from databases (such as MySQL). Why use PHP/Who should use it? Anyone who is going to run a large website would make their life easier with PHP and a database. It's easier to retrive content and it makes it possible for anyone with a webbroser to add content. (This allows you to make newsscripts, polls, counters, etc..) All in all it makes a webpage more interactive and fun to surf. What you need You will need a webserver to store your scripts on and knowlagde of HTML. Since you'll be using PHP it also has to support it. (If you're just going to play around then you could just host it yourself, PHP is avalible for both Windows and linux.) My httpd of choice is apache. PHP can be found here. In this tutorial I will not go through the installation of the server and php, as there are hundreds of tutorials on this subject to be found elsewhere on the internet. (Just google it) Getting started We'll start simple. To jump in and out of "PHP-mode" you simply: <?php // Anything put between the <?php and the ?> will be processed as PHP. ?> That's easy. See the two slashes? (//) They are used for commenting, anything on a line that's behind them will not be processed. There are also other ways to comment, like "#" which does the same as "//", and "/*" and "*/". The last ones can be spread over as many lines as you like. If you want something to output onto the page where the script is, you can use echo or print, two very similar commands. <?php echo("This is my first PHP-script!"); // This does the exact same as the above one echo "Hello!"; ?> There are thousands of commands to be used, all of them can be found on the php website. www.php.net www.apache.net Quote Link to comment Share on other sites More sharing options...
Guest anon Posted June 11, 2003 Report Share Posted June 11, 2003 All tutorials are welcome. Please continue. 8) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.