Jump to content

[ask] Create pop up windows using PHP, is it possible?


Personal_Worker

Recommended Posts

PHP isnt really an application, its just a web programming language. You can use javascript to make a popup and php to make the content of it f you want:

alert('<?php echo "hi, this is a popup!!"; ?>');

Link to comment
Share on other sites

PHP isnt really an application, its just a web programming language. You can use javascript to make a popup and php to make the content of it f you want:
alert('<?php echo "hi, this is a popup!!"; ?>');

thanks friendbut one thing i need to ask you..is that we can implement the php code into the javascript block?for example..<script LANGUAGE = "javascript"><?PHP //.....PHP code here..(open database or something like that)?></SCRIPT>I tried it already...but it didnt work...thanks before..:)
Link to comment
Share on other sites

You would need to have it like this:

<script type="text/javascript">alert('<?php echo "what you want"; ?>');</script>

But why would you need to connect to the database in the javascript? You could just do that at the head of the page! This is normally done because of echoing, not connecting to databases!Did you know you dont need to use <?php ?> to define php?You can also use <script type="php"></script>!

Link to comment
Share on other sites

No, you cant really. Java is wayyy more complex than php, same with .NET!That would be just a dream to have that happen eguru.
I wouldn't say that conclusively...after all, look at how much closer to Java and C++ PHP5 is compared to PHP4...give it a few years and I bet it'll catch up. I've actually toyed with the idea of using javascript written by PHP code...havn't tried it yet though.
Link to comment
Share on other sites

for example..<script LANGUAGE = "javascript"><?PHP //.....PHP code here..(open database or something like that)?></SCRIPT>
People seem to get confused about this. PHP is a server-side language, the server executes it. By the time your browser gets the web page sent to it, the server has finished executing the PHP. Javascript is a client-side language, your browser executes it. Your browser doesn't know what to do with PHP code, because PHP requires a server to execute it, which, again, happens before the page is even sent to the browser.Also, you can already write Windows applications using PHP, but it's a bit clumsy and still requires PHP to be installed on the machine that is running the program. There is a project called PHP-GTK that you can use to do that, it's fun to play around with but if I was asked to develop a Windows application it would be pretty low down on the list because of the requirement that PHP still needs to be installed. But once someone comes out with a PHP compiler, that will all change. Even .NET requires the .NET framework to be installed, but at least it's a lot easier to do that then it is to install PHP. Java also requires the JVM or JREE to be installed, but again, it's easier to do that then it is to install PHP.But if someone figures out how to build a PHP compiler for Win32/Win64, watch out.
Link to comment
Share on other sites

Lol, ill watch for the compiler :). Hmm, never really thought about it that way! What im talking about is the functions, with java you can make a code so when you hit space a rectangle moves sideways, and other things like that. Ill be waiting for you to make me on of these with pure php. :)

Link to comment
Share on other sites

Phalanger just looks like it builds .NET web applications using PHP, which would be cool for .NET programmers who dig PHP, Priado looks decent but either has no community or no support, they have a 5-month old forum with no programs posted. Roadsend looks pretty cool, I might need to check that out.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...