Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

1. PHP: What, Why, and Where? > Writing Your Second Program

Writing Your Second Program

Why wait around before going a little further into PHP? You probably got interested in PHP because you wanted to make your web pages do a little more than is possible with JavaScript. If that’s the case, PHP is a great language, and you need to learn how to get code like you’ve already written onto the Web. And because most PHP programs are accessed by web pages, you’ll often start your PHP programming with an HTML page that will send information to your PHP scripts.

Start with an HTML Page

To get started, open up a new document in your text editor or favorite HTML editor, and create this HTML page:

<html>
 <head>
  <link href="../css/phpMM.css" rel="stylesheet" type="text/css" />
 </head>

 <body>
  <div id="header"><h1>PHP & MySQL: The Missing Manual</h1></div>
  <div id="example">Example 1-1</div>

  <div id="content">
    <h1>Welcome!</h1>
    <p>Hello there. So I hear you're learning to be a PHP programmer!</p>
    <p>Why don't you type in your name for me:</p>
    <form action="scripts/sayHelloWeb.php" method="POST">
      <p>
        <i>Enter your name:</i> <input type="text" name="name" size="20" />
      </p>
      <p><input type="submit" value="Say Hello" /></p>
    </form>
  </div>

  <div id="footer"></div>
 </body>
</html>

  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial