Re: [PHP-DB] Re: Sort Order Description

2004-03-11 Thread Bruno Ferreira
[EMAIL PROTECTED] wrote:

[snip...]

The following is at the beginning of the script:

# get sort order (if any) passed to script
$sort_field = $_REQUEST['sort_field'];
if (! $sort_field) {$sort_field = "(ssa1202.total/vapall.vapall)*100";}
$sort_order = $_REQUEST['sort_order'];
if (! $sort_order) {$sort_order = "desc";}


   First things first. That code (it seems to me) is vulnerable to SQL 
injection. Better fix that first...

   Bruno Ferreira
---
[This E-mail scanned for viruses by Declude Virus]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Re: Sort Order Description

2004-03-11 Thread kc68
I'm not clear on your question.  The code I quoted, set forth below, has 
the text that ends up above the table.  The following introduces the 
series of column headings with sort statements (of which the initial code 
is one):

# write out title
if ($sort_order == "asc") {$sort_title = "Ascending";} else {$sort_title = 
"Descending";}
echo "Data Set Sorted By $sort_field in $sort_title 
Order\n";

# write out table heading
echo "\n";
echo "\n";

The following is at the beginning of the script:

# get sort order (if any) passed to script
$sort_field = $_REQUEST['sort_field'];
if (! $sort_field) {$sort_field = "(ssa1202.total/vapall.vapall)*100";}
$sort_order = $_REQUEST['sort_order'];
if (! $sort_order) {$sort_order = "desc";}
Thanks.

On 12 Mar 2004 00:12:41 -, David Robley <[EMAIL PROTECTED]> wrote:
[EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]:

How can I have the explanation above a php table on a sort come out as
something different than the sort coding?  For example, the sort line
below results in the following text above the sorted table: "Data Set
Sorted by (ssa1202.total/vapall.vapall)*100 in Descending Order".  I'd
prefer simply "Data Set Sorted by Percent in Descending Order."  I
tried naming the sort field "as Percent" but that didn't change
anything.
echo "PercentSort\n";
Ken

Without seeing the code that produces the text above the table, its a bit
hard to give any suggestions.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Sort Order Description

2004-03-11 Thread David Robley
[EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]:

> How can I have the explanation above a php table on a sort come out as
> something different than the sort coding?  For example, the sort line 
> below results in the following text above the sorted table: "Data Set 
> Sorted by (ssa1202.total/vapall.vapall)*100 in Descending Order".  I'd
> prefer simply "Data Set Sorted by Percent in Descending Order."  I
> tried naming the sort field "as Percent" but that didn't change
> anything. 
> 
> echo "Percent href='ssa1202.php?sort_field=(ssa1202.total/vapall.vapall)*100&sort_ord
> er=desc' target='_self'> size='2'>Sort\n"; 
> 
> Ken
> 

Without seeing the code that produces the text above the table, its a bit 
hard to give any suggestions.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php