Web Hosting Talk







View Full Version : Can php do pop-ups?


galacnet
02-16-2005, 10:33 AM
Hello,

Is php able to generate pop ups? or must I use Java?

Something like

if ( $value => 1 )
{
Do a POP Up
}


Searched php.net... can't seem to find the code.

Thanks

fastduke
02-16-2005, 11:24 AM
if ( $value => 1 )
{
echo "JavaScript code here";
}

galacnet
02-16-2005, 11:35 AM
Thank You its working :)

Rich2k
02-16-2005, 11:55 AM
Originally posted by galacnet
Hello,

Is php able to generate pop ups? or must I use Java?

Something like


Searched php.net... can't seem to find the code.

Thanks

Well it depends what you are trying to do. PHP is SERVER side code and a popup is executed from CLIENT side code.

Now of course it could be that, for instance, a certain variable is in the query string or has been submited from a form post you want to popup a window.... in which case you could do the if detection server side and just output a javascript window.open command in the HTML.

galacnet
02-16-2005, 08:39 PM
I see. Thanks.

so next time I want to do a Server Side application like Java, the "echo" command will excute them?

ilyash
02-16-2005, 08:52 PM
Originally posted by galacnet
I see. Thanks.

so next time I want to do a Server Side application like Java, the "echo" command will excute them?
??
You are not doing java.. you are doing javascript.. the language has nothing in common.

when you do echo you echo the static parts of the page.. aka html or javascript.

galacnet
02-16-2005, 08:55 PM
Yes sorry for the short form. I am doing javascript.
Thanks for the advice.