Web Design

(Nancy Kaufman) #1

283


CHAPTER

Creating Dynamic Pages 12


Can I organize my files in the server’s root
directory?
Yes. You can — and should — have subfolders for
documents and images and any other assets, just
as you would for a static site. You simply need to
ensure that all of the site’s assets are either directly
in the server root or in a subfolder of the root.

Do I always need to type http://localhost in
order to access my site?
Yes. PHP pages must be processed by PHP in order
to work, and only your Web server can pass the
pages to PHP for that processing. You thus need to
request the page from the server, which is done by
accessing it via http://localhost.

Test the Page in a Browser


1 Open your Web browser to
http://localhost/?, replacing
? with the filename you used
in Step 5.


● The browser displays the
page.

5 Type a filename.


Note: Be sure to add the .php
extension.


6 Click Save.


5


1


6


TIPS

Free download pdf