php passthru

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dacenafan
Forum Newbie
Posts: 1
Joined: Tue Jan 24, 2012 5:04 am

php passthru

Post by dacenafan »

i have a c++ file, compiled it into a .exe..

Code: Select all

#include<iostream>
#include<stdlib.h>
#include<conio.h>
using namespace std;

int main()
{
int a;
cin>>a;
cout<<a;
    return 0;
}
now, i want to run this using passthru and pass some input for int a..
i'm using this:

Code: Select all

echo passthru('2.exe && 5');
but this isnt working.. i'm getting garbage value.. any idea why ??
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: php passthru

Post by Christopher »

passthru() sends the contents of the file to the browser. You should look at exec().
(#10850)
Post Reply