I've used the <iframe> tag in Internet Exploder to talk to the server via
javascript.  It may be possible using a regular frame also.  Here's the low
down on how I did it.

1.) Some onclick, onchange ... action calls a javascript function that looks
like this
        function getData() {
                document.all.hidden_frame.src =
"databaseactions.php?getmesomedata=something";
        }
        

2.) The output of databaseactions.php would look like
        <html>
        <head>
        <script language="JavaScript">
                var contacts = new Array("Jeff Boyer","555-555-5555);
        </script>
        </head>
        <body onload="parent.loadselectbox(contacts);">
                Put something here for debugging
        </body>
        </html>

The frame is hidden (width and height set to 0) so the client does not see
the output.

3.) A function on the main page called loadselectbox gets the array of data
returned from the server.  You need to rawurlencode the data elements in the
array or javascript will complain.

Tuna Out,
Dustin

> Hello Alex,
> 
> Sunday, January 21, 2001, 4:20:53 AM, you wrote:
> 
> AB> no without submitting information to the server with get or post.
> 
> AB> for example, if a bit of javascript you have comes up 
> with some value, the
> AB> only way you can get it to the server is to put it in a 
> get and send the
> AB> user to that url:
> 
> AB> http://www.mysite.com/index.php?your_js_var=your_value
> 
> You could also post WDDX packets generated by JS, if you intend to
> operate with large and complex data. Sometimes it's much more
> convenient. But, of course, using POST, cause PHP haven't learned mind
> reading yet :)
> 
> -- 
> Best regards,
> Max A. Derkachev mailto:[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to