Basically, what you would have on a standard Apache-generated folder index. But I'm still a PHP foole, so any relatively unpatronizing help would be awesome. All I can sorta figure out at this point is that I probably need to use the GET superglobals, and set up some additional MySQL commands. Maybe a function? But I don't know.
― Girolamo Savonarola, Wednesday, 6 April 2005 22:42 (twenty years ago)
http://www.kryogenix.org/code/browser/sorttable/
― happy fun ball (kenan), Wednesday, 6 April 2005 22:52 (twenty years ago)
― Girolamo Savonarola, Wednesday, 6 April 2005 23:34 (twenty years ago)
It allows you to edit and delete rows from your db without allowing too much back-end access. Not sure what you're looking for but thought I'd throw it out there.
Javascript isn't anything to worry about unless you don't like it for developer reasons, I used that script without knowing a thing about javascript.
― teeny (teeny), Wednesday, 6 April 2005 23:45 (twenty years ago)
If you need to, consider using the ORDER BY part of the sql instead.http://dev.mysql.com/doc/mysql/en/sorting-rows.html
― Mr Noodles (Mr Noodles), Thursday, 7 April 2005 02:32 (twenty years ago)
― happy fun ball (kenan), Thursday, 7 April 2005 02:49 (twenty years ago)
― happy fun ball (kenan), Thursday, 7 April 2005 03:00 (twenty years ago)
http://www.website.com/page.php?sort_by=name
then in your php do this:
if ($_GET['sort_by'] == 'name1') { // Code for sorting array by name1 data.}else if ($_GET['sort_by'] == 'name2') { // Code for sorting array by name2 data.}
// Code for printing table using sorted array.
― fortunate hazel (f. hazel), Thursday, 7 April 2005 03:33 (twenty years ago)
http://www.website.com/page.php?sort_by=name&order=asc
whether or not the GET variable 'order' has a value of 'asc' or 'desc' depents on its current value. if it's current value is 'asc' then write your php so it prints out the link with 'desc' and vice-versa.
$sort_by = $_GET['sort_by'];$order = $_GET['order'];if ($sort_by == 'name1'){ if $order = 'desc' { // Code for sorting by name1, descending order. } else { // Code for sorting by name1, ascending order. }}else if ($sort_by == 'name2'){ if $order = 'desc' { // Code for sorting by name2, descending order. } else { // Code for sorting by name2, ascending order. }}...and so forth until you've covered all your links. Then print out the table:// Code for printing table using sorted array.if ($order == 'asc') { // Print out the URL for the links giving order a value of 'desc' like // http://www.website.com/page.php?sort_by=name&order=desc }else { // Print out the URL for the links giving order a value of 'asc' like // http://www.website.com/page.php?sort_by=name&order=asc }
if ($sort_by == 'name1'){ if $order = 'desc' { // Code for sorting by name1, descending order. } else { // Code for sorting by name1, ascending order. }}else if ($sort_by == 'name2'){ if $order = 'desc' { // Code for sorting by name2, descending order. } else { // Code for sorting by name2, ascending order. }}
...and so forth until you've covered all your links. Then print out the table:
if ($order == 'asc') { // Print out the URL for the links giving order a value of 'desc' like // http://www.website.com/page.php?sort_by=name&order=desc }else { // Print out the URL for the links giving order a value of 'asc' like // http://www.website.com/page.php?sort_by=name&order=asc }
Not super elegant, but it should work.
― fortunate hazel (f. hazel), Thursday, 7 April 2005 04:02 (twenty years ago)
― fortunate hazel (f. hazel), Thursday, 7 April 2005 04:03 (twenty years ago)
― Girolamo Savonarola, Thursday, 7 April 2005 15:05 (twenty years ago)
― happy fun ball (kenan), Thursday, 7 April 2005 15:06 (twenty years ago)
― koogs (koogs), Thursday, 7 April 2005 15:21 (twenty years ago)
― happy fun ball (kenan), Thursday, 7 April 2005 15:23 (twenty years ago)
I have a XLS spreadsheet with about 10 columns and a whole bunch of data. I want other users to be able to search and get results from this data, either in a broswer or (preferably) a simple, standalone application.
I would like to have about 4 search boxed, and any results which match all or part of the terms enter would show up. And that's it - users don't need to edit the data, just look it up.
I'm assuming some combination of PHP / SQL would do the trick (MyPHPAdmin?) but I've never done it before, and my PHP skillz are weak... thanks all.
― Huey in Melbourne (Huey in Melbourne), Thursday, 26 October 2006 22:50 (nineteen years ago)
Excel spreadsheets don't take kindly to sql queries, it's a spreadsheet rather than a database. (it does sound like the sort of thing that's been solved hundreds of times before though so you might find something out there already. windows software not my speciality, sorry)
slurping the data from a spreadsheet to a noddy database probably wouldn't be too hard though (depends on data types and volumes but generally php can read xls speadsheets). then a noddy form with the values used to generate a query, another page to display results. not a lot to it, a day's work probably. that said, it is 3 or 4 different technlogies strung together, lots of installing and configuring and reading of manual pages. (phpmyadmin will give you web access to mysql database but it's a bit raw, a nice web page might be better)
that said, i think you'd be better off using Access and its web form things.
or this? Excel 2002 Sample: On-screen, Printed, and Web Formshttp://www.microsoft.com/downloads/details.aspx?FamilyID=E3C2C9F3-E52E-49EB-A529-47E5AEF03714&displaylang=en#QuickInfoContainer
― Koogy Yonderboy (koogs), Friday, 27 October 2006 07:46 (nineteen years ago)
― pens, action figures and glass shards (unclejessjess), Friday, 27 October 2006 10:28 (nineteen years ago)
― Huey in Melbourne (Huey in Melbourne), Saturday, 28 October 2006 23:30 (nineteen years ago)
I'm completely new to PHP, and what I want to do is to collect the links from a certain website and then to go to those pages to download their data. The thing is, those links are javascript links -- I don't know from JS, but I can get to the linked pages by copying the JS link and pasting it into the browser location bar... how can I do the same through PHP?
― Leee, Thursday, 18 September 2008 15:56 (seventeen years ago)
You can't.
― Traycer Hand (libcrypt), Thursday, 18 September 2008 16:04 (seventeen years ago)
The only thing you can do w/o a JS engine is to unroll the JS logic and duplicate it in PHP.
> I can get to the linked pages by copying the JS link and pasting it into the browser location bar...
example? doesn't need to be real.
― koogs, Thursday, 18 September 2008 18:57 (seventeen years ago)
use wget.
― Jarlrmai, Thursday, 18 September 2008 19:10 (seventeen years ago)
I can't even if the script already logs me into the site (complete w/ cookies)? (Nb. I obviously didn't write that part of the script.)
Here's a sanitized version of a link that I want to send (don't know what's relevant; redactions in all caps):
javascript:WebForm_FUNCTIONTHINGY(new%20WebForm_POSTFUNCTION("SOMELONGSTRING",%20"",%20false,%20"",%20"/PARTOFTARGET_URL&",%20false,%20true))
― Leee, Thursday, 18 September 2008 21:32 (seventeen years ago)
if that is just doing a post to a form like the name suggests then it should be possible. look at the source, try and see what it's doing. you can spoof post requests with wget if you have that available.
from there it's easy enough to use curl from within php or this: http://netevil.org/blog/2006/nov/http-post-from-php-without-curl
― koogs, Friday, 19 September 2008 21:39 (seventeen years ago)