Re: pop up windows

From: Date: Fri, 26 Jan 2001 23:10:33 +0000
Subject: Re: pop up windows
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-6218@lists.php.net to get a copy of this message
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. <SCRIPT> alert('<?echo($user);?>'); </SCRIPT> 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"): <SCRIPT> alert('bjorn'); </SCRIPT> 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: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#6218) next »