Ok I have 45 minutes left to make this script default to show +ACI-a+ACI- listings on the browse.php page and then show no listings on other pages by default for some reason the +AF8-Server function stopped working what have I done wrong... +ADw-?php //alphabetical pagination links // Function to create paging. function createPaging(+ACQ-selectedLetter +AD0- null) +AHs- +ACQ-letters +AD0- range('A','Z')+ADs- array+AF8-push(+ACQ-letters, 'nums')+ADs- +ACQ-menu +AD0- ''+ADs- //if the page is browse default to A's if on other pages just show pagination links and not default listings if (+ACI-browse.php+ACI- +AD0APQ- +ACQAXw-SERVER+AFs-'SCRIPT+AF8-FILENAME'+AF0-) +AHs- +ACQ-letter +AD0- +ACI-A+ACIAOw- +AH0-else +AHs- +ACQ-letter +AD0- NULL+ADs- +AH0- foreach(+ACQ-letters as +ACQ-letter) +AHs- if(+ACQ-letter +AD0APQ- +ACQ-selectedLetter +ACYAJg- +ACQ-selectedLetter +ACEAPQ- 'nums') +AHs- +ACQ-menu .+AD0- sprintf('+ACU-s+ACY-nbsp', +ACQ-letter)+ADs- +AH0- else if(+ACQ-letter +AD0APQ- +ACQ-selectedLetter +ACYAJg- +ACQ-selectedLetter +AD0APQ- 'nums') +AHs- +ACQ-menu .+AD0- sprintf('+ACU-s+ACY-nbsp', '+ACM-', '+ADw-hr+AD4-')+ADs- +AH0- else +AHs- if(+ACQ-letter +AD0APQ- 'nums') +AHs- +ACQ-menu .+AD0- sprintf('+ADw-a href+AD0AIg-browse.php?letter+AD0AJQ-s+ACIAPgAl-s+ADw-/a+AD4AJg-nbsp+ADs-', 'nums', '+ACM-')+ADs- +AH0- else +AHs- +ACQ-menu .+AD0- sprintf('+ADw-a href+AD0AIg-browse.php?letter+AD0AJQ-s+ACIAPgAl-s+ADw-/a+AD4AJg-nbsp+ADs- ', +ACQ-letter, +ACQ-letter)+ADs- +AH0- +AH0- +AH0- return +ACQ-menu+ADs- echo ('+ADw-HR+AD4-')+ADs- +AH0- // Function to show just paging. function index() +AHs- // Echo only paging. echo createPaging()+ADs- +AH0- // Function to show results if page was given. function browse(+ACQ-selectedLetter) +AHs- // Echo paging. echo createPaging(+ACQ-selectedLetter)+ADs- echo '+ADw-br+AD4-'+ADs- //Show all restaurants that start with +ACQ-letter not between +ACI-A+ACI- and +ACI-Z+ACI- if (+ACQ-selectedLetter +AD0APQ- +ACI-nums+ACI-) +AHs- for(+ACQ-i +AD0- 0+ADs- +ACQ-i +ADwAPQ- 9+ADs- +ACQ-i+++8-) +AHs- +ACQ-sql +AD0- +ACI-SELECT DISTINCT ID, name, address FROM restaurants WHERE name LIKE '+ACQ-i+ACU-'+ACIAOw- +ACQ-result +AD0- mysql+AF8-query(+ACQ-sql) or die(mysql+AF8-error())+ADs- while(+ACQ-row +AD0- mysql+AF8-fetch+AF8-assoc(+ACQ-result)) +AHs- echo '+ADw-br+AD4-'+ADs- +ACQ-name +AD0- +ACQ-row+AFs-'name'+AF0AOw- printf('+ADw-br+AD4APA-a href+AD0AIg-view.php?ID+AD0AJQ-s+ACIAPgA8-b+AD4AJQ-s+ADw-/b+AD4APA-br /+AD4AJQ-s+ADw-br /+AD4APA-br /+AD4APA-/a+AD4-', +ACQ-row+AFs-'ID'+AF0-, +ACQ-row+AFs-'name'+AF0-, +ACQ-row+AFs-'address'+AF0-)+ADs- +AH0- +AH0- +AH0- else +AHs- +ACQ-sql +AD0- +ACI-SELECT DISTINCT ID, name, address FROM restaurants WHERE name LIKE '+ACQ-selectedLetter+ACU-'+ACIAOw- +ACQ-result +AD0- mysql+AF8-query(+ACQ-sql) or die(mysql+AF8-error())+ADs- while(+ACQ-row +AD0- mysql+AF8-fetch+AF8-assoc(+ACQ-result)) +AHs- +ACQ-name +AD0- +ACQ-row+AFs-'name'+AF0AOw- printf('+ADw-a href+AD0AIg-view.php?ID+AD0AJQ-s+ACIAPgA8-b+AD4AJQ-s+ADw-/b+AD4APA-br /+AD4AJQ-s+ADw-br /+AD4APA-br /+AD4APA-/a+AD4-', +ACQ-row+AFs-'ID'+AF0-, +ACQ-row+AFs-'name'+AF0-, +ACQ-row+AFs-'address'+AF0-)+ADs- +AH0- +AH0- +AH0- // Main controller which page to show. if (isset(+ACQAXw-GET+AFs-'letter'+AF0-)) +AHs- browse(+ACQAXw-GET+AFs-'letter'+AF0-)+ADs- +AH0- else +AHs- index()+ADs- +AH0- ?+AD4- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php