Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tables were deprecated? And JavaScript has libraries? Help me catch up!

Tags:

php

webforms

I need to tweak the web interface of an in-house print system, but it's going on a decade since I touched HTML. Could anyone recommend some tutorials on writing HTML forms and processing them in PHP? Google only gets me eight-year-old resources with big "for historical purposes only" banners on top, possibly because all my vocabulary is eight years old.

The documentation on php.net is good, but I'm looking for larger examples showing how all the pieces fit together, preferably with commentary explaining the programmer's thoughts. I can look up function APIs just as well as the next guy.

Edit: Specifically asking about PHP and HTML forms. Sorry if the title was misleading---I only meant to give a few examples of things I didn't know.

like image 881
Wang Avatar asked Nov 10 '09 23:11

Wang


People also ask

What does deprecated mean in JavaScript?

This page lists features of JavaScript that are deprecated (that is, still available but planned for removal) and obsolete (that is, no longer usable).

Why is my JavaScript not working on Chrome?

Google ChromeIn the "Settings" section click on the "Show advanced settings..." Under the the "Privacy" click on the "Content settings...". When the dialog window opens, look for the "JavaScript" section and select "Allow all sites to run JavaScript (recommended)". Click on the "OK" button to close it.


3 Answers

Tables are only "deprecated" when talking about tables for positioning the elements of the layout (header, menu, content, footer, etc). They are less or more replaced by CSS and HTML block elements (usually the div element is been used). Tables are still useful to display tabular data.

There are indeed more JS libraries out than previously. With jQuery as the topper. Main goal of those is to remove the developer's stress about browser specific behaviours and lengthy/repeated/unintuitive code.

Nowadays HTML is supposed to be purely semantic. CSS is supposed to style and position the HTML elements individually. JS is supposed to add just that extra user experience to the page (to avoid unnecessarily lengthy request-response cycles and "flash of content") and ought to be kept unobtrusive.

PHP is still a server side hypertext processing language. You can use it to pre- and postprocess requests and to control the flow and access the data in the HTML page.

like image 89
BalusC Avatar answered Nov 15 '22 04:11

BalusC


let me suggest to you www.alistapart.com. It has eveything about the state of the art of modern HTML and CSS (and some hints on javascript too).

Another very good resource is nettuts

"are you from the past ?"

like image 31
gpilotino Avatar answered Nov 15 '22 02:11

gpilotino


I've found that, for when I've forgotten something, Tizag.com to be pretty useful, a simple tutorial -though it is simple, so I don't know how useful it might be to you- is here, at: http://www.tizag.com/phpT/examples/formex.php, which provides a walk-through with some explanation of the choices made.

Javascript libraries,

  1. jQuery.
  2. mootools.
  3. Glow (from the BBC, open source and very backwards-compatible).


Edited in response to comment

More reliable php references to help you get started:

  1. Getting started (php.net)
  2. forms tutorial (as above, at php.net)

The problem I'm finding with php/forms tutorials (outside of books) is that there's some crazy mis-use of -to my mind, ymmv, etc...- xhtml tags inside of forms, completely disregarding the concept of -mentioned elsewhere- semantic (x)html. I think that when reading the tutorials the key is to maintain a critical mind and try to be alert to the ab-, or mis-, uses:

<form action="this_page.php" method="post" enctype="form/multipart">
<p>This is a label <input value="this is the input" /></p>
<p><input type="submit" value="submit" /></p>
</form>

may be valid, but to my mind it's hideously wrong1. I'm amazed that there aren't more easily available and up-to-date resources.


1: To my mind it should be something closer to:
<form action="this_page.php" method="post" enctype="form/multipart">
    <fieldset> // to associate relevant groups of label/input pairs
        <label>This is a label</label> <input value="this is the input" />
    </fieldset>

    <fieldset>
        <input type="submit" value="submit" />
    </fieldset>
</form>
like image 22
David Thomas Avatar answered Nov 15 '22 02:11

David Thomas