Jump to content

launching external applications

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
scrubber

scrubber

    Newbie

  • Members
  • Pip
  • 3 posts
i am trying to tie together some php programs, using php-gtk2 for a non-html system. i have a login script that upon successful login sends you to the main page. i cannot for the life of me figure out how one launches an external application, in this case from the login script to the main-page.
i have used shell_exec, exec, proc_open, pcntl_exec ... no luck.
could someone point me in the right direction for solving this conundrum?

any help would be greatly appreciated.

jim s.

#2
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
The problem is that you are using PHP-GTK2. Building a desktop application in PHP is like building a house with toothpicks. Sure it's possible, but its just dumb. That being said, why are you trying to execute a script?

#3
scrubber

scrubber

    Newbie

  • Members
  • Pip
  • 3 posts
hi john

reason being i have about 300 (lost count) php scripts that download and process data from the web ... using curl. originally i planed to execute them from the command line. this has turned into a nightmare and i was hoping to use php-gtk to make using these scripts easier. the reason for php-gtk is that it is a relative of php and i should be able to transfer any knowledge of php to php-gtk.

any suggestions for a different way to go would be appreciated.

thanks

jim s.

#4
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
Perhaps I am missing something, but why can't you just include() the files, and call the necessary functions? But to answer your original question, both shell_exec and exec should work.

script.php
echo "Hello, World\n";

test.php
echo shell_exec("php script.php");

output
> php test.php
Hello, World!
>


#5
scrubber

scrubber

    Newbie

  • Members
  • Pip
  • 3 posts
john;

thanks for the examples. shell_exec works fine. i have no idea why it did not work for me a few weeks back. in any event ... thanks for the suggestion. sometimes i get the detailed stuff ... no problem but am completely thrown off course on the simple stuff.

thanks again

jim s.