Advanced PHP for Web Development by Christopher Cosentino

Advanced PHP for Web Development by Christopher Cosentino

Author:Christopher Cosentino [Cosentino, Christopher]
Language: eng
Format: epub
Tags: Web, Page Design, Networking, Programming Languages, Electronic Books, Web Site Development, Computers, Programming, General, Internet, Web Page Design, PHP (Computer Program Language)
ISBN: 9780130085399
Google: McRT5V5q5GQC
Barnesnoble:
Publisher: Prentice Hall
Published: 2003-11-15T08:00:00+00:00


Figure 6-2. stockquote.php

Script 6-2. stockquote.php Line-by-Line Explanation

LINE

DESCRIPTION

1–8

Print out the beginning HTML for the page, as well as a form asking for the symbol of the stock for which the user wishes to retrieve a quote.

9

Begin the PHP for the page.

10

Check to see if the $symbol variable has been set. If it has, then execute lines 11–26.

11

Assign the $file variable to the page that has stock quote information.

12

Assign the data opened from the file() function to the $contents variable. The file() function's argument ($file . $symbol) is the URL appended with the stock quote symbol entered by the user. For example, if the user entered "CSCO" (the symbol for Cisco Systems), then the argument is "http://www.reuters.com/quote.jhtml?ticker=CSCO".



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.