Re: [PHP-DB] pop up windows

2001-01-26 Thread Tom Carter

Hi John,

The essential difference between PHP and JavaScript is that PHP is
server-side and JavaScript client side. What this means is that when a
user requests a PHP page, all the functions, commands etc are run on the
server and then sent to the users machine, where as with JS the code is
effectively downloaded to the users machine and then run there.

In practice this means that anything which involves manipulating the users
computer (as opposed to just displaying output, which is what PHP does)
can only be done in JavaScript. Hence pop-up windows, which are
mainuplations of the users machine, are impossible in PHP alone.

However, what is possible, and I've found very powerful, is to use PHP to
create dynamic JS.

Essentially you use PHP to make JS in the same way it makes html

eg.


alert('');


What would happen here is that the php parser on the server would run
first, and replace the echo statement with the value of $users, and then
return the javascript for the users machine to process, ie the user in
this case would recieve the following (assuming $user="bjorn"):


alert('bjorn');


Hope this helps,

Tom

On Fri, 26 Jan 2001, John Miller wrote:

> I know that this is off the subject, but I am hoping that some would be 
> kind enough to tell me what I would like to know.  In java script there is 
> an alert "command" that will cause a message box to popup.  Is there a way 
> to do it in php.  Better information would be to tell me where I could find 
> it in the documentation.
> 
> Thanks,
> John Miller
> 
> 
> -- 
> PHP Database 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]
> 


-- 
PHP Database 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]




Re: [PHP-DB] pop up windows

2001-01-26 Thread Mage

Hello Miller!

John Miller wrote:

> I know that this is off the subject,

yes, it is.

> but I am hoping that some would be
> kind enough to tell me what I would like to know.  In java script there is
> an alert "command" that will cause a message box to popup.  Is there a way
> to do it in php.  Better information would be to tell me where I could find
> it in the documentation.

There is only one way, and it's simple.
echo "alert\n";

PHP is server side script...

Mage




-- 
PHP Database 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]