-
Posts
471 -
Joined
-
Last visited
-
Days Won
8
Posts posted by dalecosp
-
-
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.
That will *have* to be done in JS.// limiting that the 6th checkbox doesn't become checked without first
deselecting another.
Remember that POST parameters can be arrays!So upto 5 selected checkboxes become the name="input1" through
name="input5".
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.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]
Before you ditch your "old method" ... what is it? Not everything should be replaced *just* because it's old ;-)I have an old method, what are the current solutions?
-
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, -
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
-
Welcome!
-
Pretty sure you can just do that in the Joomla config or control panel: http://help.joomla.org/content/view/51/153/1/2/
-
Ooh, don't do that ... especially on a shared server ... no need to waste those CPU cycles ;-)is it possible to make php sleep? maybe something with while(time()<_interval){} ??sleep(), or usleep() (for microseconds), as our esteemed moderator has already mentioned.
-
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).
Form processing issue
in Javascript Help
Posted
Your first and second Pastebin links both go to the sidebar template; neither links to the jQuery script.
What does your PHP script send as a response to the Ajax ... "ok", or "failed"?