Forum Moderators: coopster
I had two questions.
I have no knowledge of PHP and am wondering if it the language I need to learn in order to achieve my goal.
I'd like a page that has a data table that is sortable, and that can have rows removed, and totals calculated accordingly. Is PHP the way to do this?
In addition to this, can I use PHP to query another page that contains data, format it, and set it out how I want in a table on the page (and then sort it etc)?
Thanks! Any info at this point would be awesome. :)
PHP is a server-side language, while javascript is a browser-side language. What that means is that everything you do in php is done before the content gets sent to the browser. You use javascript to manipulate the content once it's reached the browser.
If your table data comes from a database, you'll need php or another server-side language in order to retrieve it. I'm inferring that by 'table that is sortable' you want the visitor to be able to do the manipulations. While you could use php to respond to those manipulations, it means reloading the page - the visitor sends the request to re-sort to the server and a php script sends the data back to the browser in the new order.
If you use javascript to manipulate the data that's already there at the visitor's browser, it can happen much faster since nothing gets retransmitted.
Either language can be used to query another page - which you use depends on where that page is located (whether at your web site or another) and how you want it integrated into the visitor's current page.
Learning PHP - Books, Tutorials and Online Resources [webmasterworld.com]