"Harry Yau" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
>     I am writing a HTML page to gather whole bunch of information
> provided by user and pass it to the PHP script to generate a report base
> on these information. Namely, user inputs data in textfields of a HTML
> FORM. Since, there is a lot of fields in the field, when the form
> submitted, the URL to the PHP script become very long.

That is because you sent the data as a GET.

Use a POST and the URL will not change.


>     I am wondering two way to solve this problem.
>     First, I create a PHP Class to store all Infomation and using
> JavaScript function in the HTML page to "PUT" those value of fields into
> my PHP Class Object. Then pass the PHP Class Object to the PHP script.
> However, I wondering is it possible for the JaveScript function to
> manipulate the PHP Class Object, and How? How could I Call the PHP Class
> Constructor inside the JavaScript function?? Moreover, How could I pass
> the PHP Class Object from the HTML page to the PHP Script?? Is it
> possible to do so??

In a Word, No.

you are mixing apples and oranges.

Javascript is all client-side (Yes,  I knowm just ignore server-side for
now, that is not what he is asking) and PHP is all server-side, not
client-side at all.

You use our JS to do what ever you want to do on the client machine.

Then POST your name/value pairs to your server, which in turn calls your PHP
to retrieve thosse name/value pairs and process them as needed.


>     Second solution I've thought of was writing another PHP function
> inside the  HTML page and doing the job as the JavaScript function.
> However, I have no I idea how could the HTML page call the PHP function
> when the user submitted the HTML FORM. Once again, How could I pass the
> PHP Class Object from the HTML page to the PHP Script at the end??

Agagin, same issue. You can't do anything PHP on the clinte side.

Yes think of this as 2 sides to the same coin.

The JS will handle all client-side stuff, formatting, validation,
calculations, etc and the HTML wraps it all up into name/value pairs to be
sent to the server-side process to handle.

Your server-side process, in this case PHP, will retrieve these name/value
pairs from the server, process them as needed and return back a page that
tells the user whatever you want to tell the user.

Does that help?

Walter

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to