exec() function??

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
ednark
New php-forum User
New php-forum User
Posts: 18
Joined: Fri Oct 04, 2002 8:09 pm

Sun Oct 13, 2002 9:48 pm

ok i think you have a missunderstanding of what php does...

1) you request a webpage, http://somepage.php
2) apache tries to give you the page, ie finds that file in the server directory
3) apache pauses before returning that page because it notices that you have requested a .php file, and it should first execute the file, then return the results
4) apache opens up your php.exe, and passes it the .php page you requested
5) apache waits for php to stop running your code, it then takes the text results (which should be some html) and returns them as the webpage requested


nowhere in this process is apache supposed to open up a graphical window with a calculator for you... you may however be able to call calc.exe with some other command line parameters, which may return the result of your calculation, this you can have php print out as a string, whcih is allowed to be returned....

that having been said, there is no reason you would ever want to do that, as php has simple math functionality built right in....

you cannot make php to act as a manager for what windows you have open... at least not when using php and apache through a webserver...

hope this helps

DoppyNL

Sun Oct 13, 2002 11:10 pm

executing calc.exe (or any other program) in php will open that program on the server, not on the client!
Perhaps that can be done with javascript, but I know almost nothing about javascript.

Greetz Daan

DoppyNL

Mon Oct 14, 2002 1:36 am

I don't know how to do that, but im curious on why you want to start the calculator on the server?
Since it requires user-input to work you will have to be at the server itself to be able to use it. In that case you could simply start in you'reself in windows.

Greetz Daan

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Baidu [Spider], Google [Bot] and 3 guests