cvs: pearweb /public_html accounts.php

From: Date: Sat, 14 May 2005 17:39:10 +0000
Subject: cvs: pearweb /public_html accounts.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-31856@lists.php.net to get a copy of this message
dufuz Sat May 14 13:39:10 2005 EDT Modified files: /pearweb/public_html accounts.php Log: strip tags out of PHP_SELF http://cvs.php.net/diff.php/pearweb/public_html/accounts.php?r1=1.19&r2=1.20&ty=u Index: pearweb/public_html/accounts.php diff -u pearweb/public_html/accounts.php:1.19 pearweb/public_html/accounts.php:1.20 --- pearweb/public_html/accounts.php:1.19 Wed Jan 26 07:40:05 2005 +++ pearweb/public_html/accounts.php Sat May 14 13:39:09 2005 @@ -15,17 +15,19 @@ +----------------------------------------------------------------------+ | Authors: | +----------------------------------------------------------------------+ - $Id: accounts.php,v 1.19 2005/01/26 12:40:05 pajoye Exp $ + $Id: accounts.php,v 1.20 2005/05/14 17:39:09 dufuz Exp $ */ response_header("Accounts"); $page_size = 40; +$self = strip_tags($_SERVER['PHP_SELF']); print "<h1>Accounts</h1>\n"; -$all_firstletters = $dbh->getCol('SELECT SUBSTRING(handle,1,1) FROM users '. - 'WHERE registered = 1 ORDER BY handle'); +$query = 'SELECT SUBSTRING(handle,1,1) FROM users '. + 'WHERE registered = 1 ORDER BY handle'; +$all_firstletters = $dbh->getCol($query); // I wish there was a way to do this in mysql... $first_letter_offsets = array(); for ($i = 0; $i < sizeof($all_firstletters); $i++) { @@ -56,10 +58,10 @@ $firstletters = array_unique($all_firstletters); $last = $offset - $page_size; -$lastlink = $_SERVER['PHP_SELF'] . "?offset=$last"; +$lastlink = $self . "?offset=$last"; $next = $offset + $page_size; -$nextlink = $_SERVER['PHP_SELF'] . "?offset=$next"; -print "<table border=\"0\" cellspacing=\"1\" cellpadding=\"5\">\n"; +$nextlink = $self. "?offset=$next"; +print '<table border="0" cellspacing="1" cellpadding="5" width="100%">' . "\n"; print " <tr>\n"; print ' <th class="form-label_top_center" style="font-size: 80%">'; if ($offset > 0) { @@ -77,7 +79,7 @@ printf('<b>%s</b> ', strtoupper($fl)); } else { printf('<a href="%s?letter=%s">%s</a> ', - $_SERVER['PHP_SELF'], $fl, strtoupper($fl)); + $self, $fl, strtoupper($fl)); } } print '</td><td rowspan="2" align="right">';

« previous php.pear.cvs (#31856) next »