[ILUG] [OT] Which programming language ?

Gareth Eason bigbro at skynet.ie
Wed Dec 15 13:41:14 GMT 2004


	   Hi,

	This is actually a reasonably common question, and is related to the 
user interface you wish to present your users, HCI best practice, 
suitability for purpose, and numerous other factors I haven't thought of 
now :-)

	Basically, if you want processing to be done with the data - dynamic 
page generation / modification dependant on input, etc. - Javascript is 
probably the most portable method of doing things. This means that input 
can be validated and the page modified as appropriate on the user's 
desktop, without having to 'submit' anything to the server. The 
disadvantages are that javascript can be hacked, since the user has a 
copy of it; it's not as portable as it should be between browsers, and 
it's another language to write stuff in - For a secure system, you'll 
need to re-validate the input back on the server when the user does 
submit, so it's likely you'll have to implement the same functionality 
in both PHP and Javascript for that to work.

	Provided the page contents are 'sized' for the connection between user 
and server, then submitting between pages and generating the new page 
based on user input shouldn't be a problem for the user, lag-wise. Of 
course, you'll need to scale the webserver to handle this load, 
dependant on number of concurrent users and the complexity of the input 
validation and other processing. Static graphics will likely be cached 
and so can be allowed - and the rest of the processing you allude to is 
merely some numeric and string input - shouldn't be a problem I'm 
guessing (but without a specification I can only guess, of course.)

	What you list as your current format is certainly a well established 
and acceptable practice - the 'wizard' format, if you will :-)  It 
provides a clear line of progression, allows the user to traverse 
linearly ( because branches (if any) are handled by the server and are 
conceptually insignificant to the user, if done correctly) the data 
input sequence.

	This means you can write everything in PHP and do all your input 
validation and page generation on the server. Nothing wring with that at 
all.

	Often, it's convenient to do simple validation of data (input must be a 
string, input must be a number, input but be between certain values, 
input is required and cannot be left blank, etc.) using javascript. 
Plenty of examples of this type of code are available on the net. 
http://www.echoecho.com/jsforms03.htm was the first google result 
returned for me for a search of +example +javascript +validation. Mixing 
javascript to do simple validation immediately, before form submission, 
is often veyr helpful - speeds things up - and is quite acceptable. 
Indeed, without it some of the larger websites would have difficulty 
scaling to the concurrent user numbers they handle.

	Hope this helps somewhat. :-)

	Best regards,
	-->Gar



Declan Grady wrote:
> Gareth Eason wrote:
> 
>>     Hi,
>>     Please do call back again. Apart from the trolling, irrelevant 
>> replies, responding before reading what's been said previously in the 
>> thread, arbitrary and unnecessary zealotry, religiously guarded 
>> 'opinions' on operating systems, editors and languages, and numerous 
>> other faults and failings that seem inherent in any mailing list, 
>> we're mostly a nice and reasonably helpful bunch :-)
>>
> <snip>
> I'm back..
> I've managed to do some basic (no pun intended) php which takes the 
> input from a form and does some calculations and mysql lookups ... so 
> far so good.
> 
> So far, I have one page with a form, all fixed data.
> The variables assigned by all these input boxes, checkboxes and radio 
> buttons are then posted as variables to my php script which processes 
> once I press the "submit" button. - ok, so far so good.
> 
> Now, after this processing I need to take more data from the user, and 
> do more processing, then take more data and do some more processing .. 
> etc etc ..
> 
> Am I going the right way .. I think I'm missing the point somewhat ..Is 
> it (easily) possible to have the page dynamically change as I enter data 
> and make selections, without having to "submit" each time.
> 
> Having said that, I do like the ease of functionality of using the back 
> button and chnaging some data, and submitting again.
> i.e. My current format would be something like:
> 1. Enter data on page1 and press submit button
> 2. process this data, and display page 2 (containing summary of data 
> entered so far and new choices)
> 3. Enter data on page2 and press submit
> 4. process this data and display page3 (containing summary of entries 
> from pages1 & 2 and new choices which are dependent on data entered)
> 5. Enter data .... etc etc.
> .... finally end up with  display of the resulting arrays, with options 
> to save/print/modify ... etc.
> 
> I am building up a few arrays of the results of the processing and using 
> variables from all pages so far submitted.
> 
> I guess Im away off on a tangent from where I should be going, but I've 
> googled and googled (and googled) to get this far and I'm stuck.
> 
> Thanks for any suggestions.
> 
> Declan
> 
> 



More information about the ILUG mailing list