Creating Your First PHP Script

Here’s where all the action startscreating your first PHP scripts. With PHP, which will be run on the web server, you can make all kinds of things happen that couldn’t happen before. You can have your PHP retrieve data from databases, check someone’s password, print out customized greeting text, use cookies, write a guest book, create interactive games, calculate sales tax, or even build your own shopping cart or chat room web applications. And all these things can run by themselves, 24 hours a day, even while you’re peacefully sleeping in bed.

Read the full story

Posted in PHP & MySQLComments (1)

Getting PHP

Welcome to PHP! “PHP” officially stands for “PHP: Hypertext Preprocessor,” but millions of people still know it by its original name, Personal Home Page, and that’s what it’s all aboutcreating your own interactive web pages in the easiest possible way. No longer will web pages have to be static, unchanging things. Now you can send the user new web pages tailored to what he or she wants to see in real time. You can handle button clicks, checkbox selections, and radio buttons and can even draw graphics interactively and store data in a database. It’s all up to you the lid is off the box.

Read the full story

Posted in PHP & MySQLComments (1)

Running PHP on the Command Line

If php is in your path, you can run this from the command line like so (where % is a generic, cross-platform command-line prompt, and this example assumes you’re in the same directory as echo.php):

Read the full story

Posted in PHP & MySQLComments (0)

Mixing PHP in Some HTML

PHP files are most often mixtures of HTML and PHP scripts. Putting HTML and PHP scripts into the same document is no problem because you put your PHP statements inside a script bounded by <?php and ?>, which means the server can pick them out easily.

Read the full story

Posted in PHP & MySQLComments (0)

Creating PHP Variables

That’s not a typoPHP lets you create variable variables. A variable variable is one that holds the name of a variable. Here’s how it works: you create a variable named, say, $apples:

Read the full story

Posted in PHP & MySQLComments (0)