13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

714 Chapter 30 Building a Mailing List Manager<br />

Listing 30.9<br />

Continued<br />

if($info) {<br />

echo "".pretty($info[listname])."<br />

".pretty($info[blurb])."<br />

Number of subscribers:".$info[subscribers]."<br />

Number of messages in archive:"<br />

.$info[archive]."";<br />

}<br />

}<br />

Figure 30.8<br />

The display_information() function shows a blurb about a<br />

mailing list.<br />

The display_information() function uses two other functions to help it achieve its<br />

web task: load_list_info() <strong>and</strong> pretty().The load_list_info() function actually<br />

retrieves the data from the database.The pretty() function simply formats the data from<br />

the database by stripping out slashes, turning newlines into HTML line breaks, <strong>and</strong> so on.<br />

Let’s look briefly at the load_list_info() function, which is in the mlm_fns.php<br />

function library.The code for it is shown in Listing 30.10.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!