Robbie Staufer wrote:

> Hi,
>
> I have a web page where I've used Java Script to set up some relational
> menus, within a php script to send form data to a perl DBI script for
> querying a database.  The user selects an option from the first menu,
> and an option from the second menu, and these values need to be passed
> either to the php section of the script, or directly to the DBI script.
>  Is this nuts, or is there a way to pass the JS values to php or DBI?
>
> Inorvermyhead,
> Robbie

Hi Robbie,

I would advise against using Perl and PHP in conjunction.  There should be no need to 
do so.  Both Perl and PHP are full-scale server-side programming languages, and either 
language alone should have adequate facilities to handle DB processing without the 
complications of inter-process communications..  If you are using PHP, you probably 
should not need to use javascript either, since PHP has some well-developed embeds to 
handle data input.  It also has DB coonnectivity utilities

Javascript/Perl is another matter.  Javascript* is a very useful, but equally limited, 
tool for client-side data validation.  The best way to use it is sparingly.  Use it to 
ensure that use input is sensible in the context of the data being sought--that dates 
are readable as dates, numerical input as numbers, phone numbers have the correct 
number of digits, etc.  You don't really address perl directly though.  Javascript 
interacts with the form objects on the web page, and you can use it to reset them:

document.FormName.FormObject.value = CorrectedValue;

then your CGI script will read the form values through the query line.

Unless you have extenxsive experience with both languages, and know exactly why you 
need to use both in conjunction, I would recommend using either Perl or PHP, but not 
both, for your server-side processing.

Joseph

*AFAIK, there is no such thing as "Java Script".  Java is a standardized, 
paltform-independent, strongly-typed, structured compiled and intepreted language.  
Javascipt is an utnyped, unstructured, interpeted language, the implementation of of 
which is dependent on the browser on which it is run.  Java was developed at Sun 
Computer.  Javascript seems to have been developed by Netscape, although the 
information I base that impression on is not at all conclusive.




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to