Jump to content

[SOLVED] Sorting refresh


l3asturd

Recommended Posts

<?php
$content .=" Sort by : <SELECT name=\"sortby\" size=\"1\" STYLE=background:#FFCC00;>";
$content .="<OPTION SELECTED>Site<OPTION>Service Tag<OPTION>User<OPTION>Computer Name";
$content .="<OPTION>Model<OPTION>Condition<OPTION>Status<OPTION>Newest<OPTION>Oldest</SELECT>";
?>

 

I know this is probably more of an HTML question, or a FORM question, but I've been trying to figure out how to make the "sortby" dropdown selection auto submit. So when someone clicks Sortby:Computer Name the page auto refreshes with the new ORDER by variable. Any help is appreciated. Thanks.

 

Link to comment
https://forums.phpfreaks.com/topic/65832-solved-sorting-refresh/
Share on other sites

If using SQL then have a hyperlink like

lists.php?sort=name&order=asc

 

then just use those in your SQL statement.. make sense ?

 

I may understand. Let's say my form action (only for the sorting dropdown) is going to be link:http://www.domain.com/list.php?sortby=Computer

 

Is this what you mean?

 

No, that's not what you mean. Let me read a few more times.

ok, well, what does this actually do?

 

list.php?sortby=name

 

does this set a $sortby variable to "name"? Or does it act like a $_POST['sortby'] variable. Hopefully it does the first thing, because I think I can work with that.

If it sets $sortby, I would just include $sortby in my SQL query right?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.