/    Sign up×
Community /Pin to ProfileBookmark

Can PHP talk to programs

I want to create a business and income financial site and use something similar to my desktop program to do the work rather then create a php program separately is this even an option.

Can php talk to a program on a server and input information from variables into it? Or am I stuck having to write my own script. If not how can I copy the scripts in my program? Their not proprietary I doubt accounting is. They just have everything in one place.

Is it possible to upload a program to a server in to do this?

Or can I have php write to javaScript to write to the program autonomously on my desktop?

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@TecBratAug 01.2011 — A better question might be, can the programs send HTTP requests and understand the reply.

PHP can be used command line, so you could change that to can the programs execute bash commands, but that's probably not what you're looking for.

It may be possible to have a program and a PHP script share a text file where both the program and a PHP script read and write to the same file.

I hope that was helpful, and not confusing.
Copy linkTweet thisAlerts:
@WonDer9authorAug 01.2011 — yeah I understand both comments.

I was just hoping that hopefully on a language level both programs could communicate with each other...yeah i know, far fetch. I just don't wanna have to re-create something as big as an actual finances application. A calculator is one thing a full blown program is another.

I taught I could do something like API's as far as sharing information sot I figured it could apply to a stand alone program but its even if already compiled.

is there a way to control how php writes to a file, lets say like a form. Basically i need it to fill in blanks with answers. Can anyone tell me what I can use to do that. or do I have to create it from scratch and fill in.

Thanks.
Copy linkTweet thisAlerts:
@TecBratAug 02.2011 — For that, it's like using a template. First, you build your template like

[code=php]
$template='
name '.$name.'<br>
address '.$address.' <br>
';
// continue pattern
[/code]

You fill out the form, submit it to your handler. Your handler loads the template. Then you write the template to a file using fopen and fwrite.

Depending on how you're using it, omit the breaks. The single quoted linebreaks are taken literally so they'll show up in your doc.
Copy linkTweet thisAlerts:
@WonDer9authorAug 02.2011 — ok cool. I was thinking an already formatted form, like a financials form or a PDF. but I see what your saying. Thanks for the info.
Copy linkTweet thisAlerts:
@NogDogAug 02.2011 — If the programs in question have some sort of command line API, you can call them via PHP's shell_exec() or exec() functions. If it's on a Windows server and the programs support it, you might be able to use PHP's [url=http://php.net/com]COM[/url] extension. Ultimately it comes down to how the other programs can be accessed. You might want to browse through the [url=http://www.php.net/manual/en/refs.remote.other.php]Other Services[/url] section of the PHP manual for some of the built-in ways to "talk" to other programs, and the [url=http://www.php.net/manual/en/refs.utilspec.windows.php]Windows Only Extensions[/url] should that be applicable in your case.
Copy linkTweet thisAlerts:
@WonDer9authorAug 03.2011 — thanks for the info. will see what the manual says. just wanted a simple way to allow users to manually input the information by them selves. Have seen a lot of sites with this system in place assumed it was php talking to the program not an actual php site. I'll have to contact the web masters to see whats going on behind the scenes.

I just couldn't imagine someone taking that much time and effort to build a site like that from scratch but who knows.
×

Success!

Help @WonDer9 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...