Jump to content

dalecosp

Members
  • Posts

    471
  • Joined

  • Last visited

  • Days Won

    8

Posts posted by dalecosp

  1. Server-side is almost always easier, unless you were born and bred in Javascript. PHP handling might also have the advantage of hiding email from spambots? (I'm not sure if I'm following you correctly on that one).

     

    However, "modern" UI's typically make use of AJAX/RESTful interfaces.

     

    // limiting that the 6th checkbox doesn't become checked without first

    deselecting another.

    That will *have* to be done in JS.

    So upto 5 selected checkboxes become the name="input1" through

    name="input5".

    Remember that POST parameters can be arrays!

    Or I could have 20 checkboxes with 20 names, any 5 of which being

    submitted in the form. But then (Server Side) I would have to map (for

    lack of a better term) 5 unknown form names to 5 set variables

    <?php

    $input1 = $_POST[" // first input from form \\ "];  

    $input2 = $_POST[" // second input from form \\ "];

    $input3 = $_POST[" // third input from form \\ "];

    $input4 = $_POST[" // fourth input from form \\ "];

    $input5 = $_POST[" // fifth input from form \\ "];[/code]

    Ditto. You could post the 5 items as an array. In this case, though, I'd have to question the sanity of presenting 20 checkboxes to the user.

    I have an old method, what are the current solutions?

    Before you ditch your "old method" ... what is it? Not everything should be replaced *just* because it's old ;-)
  2. So, I assume they'll be downloading the scripts?

    If so, some thoughts:

    a] Password protect the site, require a TOS agreement at registration.
    b] Create a "reader script" which does whatever frontend you require (filling in a TOS form), then reads the script's code from *outside* the web root and outputs it to the browser/whatever.

    c] Check $_SESSION vars at the top of each script and redirect to the TOS page if the correct variable hasn't been set (ostensibly by clicking the right boxes on the TOS).

    HTH,

  3. Greetings!  How 'funny' --- that happens to be my name as well.

     

    I'm envious of your client-side foo --- these JS frameworks seem such a mystery.  Probably because my JS-foo doesn't match my PHP-foo ;)

  4. is it possible to make php sleep? maybe something with while(time()<_interval){} ??

    Ooh, don't do that ... especially on a shared server ... no need to waste those CPU cycles ;-)

     

    sleep(), or usleep() (for microseconds), as our esteemed moderator has already mentioned.

  5. It really varies by hosting company.

     

    I used to work for a company that hosted sites for other companies on FreeBSD.  PHP cli on FreeBSD was "php -r", which is a single-line CLI tool used via SSH.  When run via cron, scripts used /usr/local/bin/php -q, generally.

     

    I program for a company now that uses a California hosting company running either RedHat or CentOS.  There I have access to "php -a" for interactive work via SSH, and cron runs scripts from /usr/bin/php, with or without "-q" (doesn't seem to matter for some reason).

×
×
  • 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.