Not really happy with the application I'm building.

    Date: 11/02/05 (PHP Community)    Keywords: php, html

    Although it works, I consider it a bit clunky.

    What I have is a form that accepts certain data, and then uses that data to build an HTML page (it's for HTML formatted marketing emails).

    The form's easy enough, as is the validation, but the problem is this:

    I have a table that needs to be built into the page, and the user needs to select how many rows and columns the table is going to be. Currently I have a structure like this


    ... standard form data...

    Columns: Rows:

    -----

    On the second page (mailout_step2.php) I carry out my validation:

    if ((!is_numeric($_POST['cols'])) || (!is_numeric($_POST['rows'])) || ($_POST['cols'] < '1') || ($_POST['rows'] < '1')) {
    // print a generic error message, an html page with hidden form fields, and a submit button to resubmit all the data back to the first page
    } else {
    $rows = $_POST['rows'];
    $cols = $_POST['cols'];
    }

    if ($rows && $cols) {
    // print a table full of text inputs for the user to fill in, and submit the new form (again will all the hidden fields) to a third and final page to validate and print the final output.
    }

    -----

    Surely there's a better (less clunky) way to do this? I know how to do single-page forms with validation all on one page, but this seems like a "dirty hack".

    Source: http://www.livejournal.com/community/php/362739.html

« sprinit Weirdness || Quick question »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home