O'Reilly logo

Modernizing Legacy Applications in PHP by Paul M. Jones

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix A. Typical Legacy Page Script

<?php 2 include("common/db_include.php"); 3 include("common/functions.inc"); 4 include("theme/leftnav.php"); 5 include("theme/header.php"); 6 7 define("SEARCHNUM", 10); 8 9 function letter_links() 10 { 11 global $p, $letter; 12 $lettersArray = array( 13 '0-9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 14 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 15 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' 16 ); 17 foreach ($lettersArray as $let) { 18 if ($letter == $let) 19 echo $let.' '; 20 else 21 echo '<a class="letters" ' 22 . 'href="letter.php?p=' 23 . $p 24 . '&letter=' 25 . $let 26 . '">' 27 . $let 28 . '</a> '; 29 } 30 } 31 32 $page = ($page) ? $page : 0; 33 34 if (!empty($p) && $p!="all" && $p!="none") { 35 $where ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required