AkaZn
asked on
Using command line
How can I use some program like Delphi or Visual C++ to get information from php file with command line. Exam:
a.php
<?php
$a=12;
echo '<html>';
echo $a;
echo '</html>'
?>
When I run the command c:\php\php.exe c:\test\a.php , it show out the command line :
<html>
12
</html>
How can I get that information from other program.
a.php
<?php
$a=12;
echo '<html>';
echo $a;
echo '</html>'
?>
When I run the command c:\php\php.exe c:\test\a.php , it show out the command line :
<html>
12
</html>
How can I get that information from other program.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
shellexecute(handle,'Open' ,pchar('C: \PHP\php.e xe'),pchar ('C:\www\t est.php >result.txt),'',0);
I think that the >filename command can only be used in msdos or nc. I have try your function but it doesn't work. But anyway, you are right. I use that command instead:
shellexecute(handle,'Open' ,pchar('co mmand'),pc har('/C 'C:\PHP\php.exe C:\www\test.php >result.txt),'',1);
It will use command (msdos) and excute php.exe.
I think that the >filename command can only be used in msdos or nc. I have try your function but it doesn't work. But anyway, you are right. I use that command instead:
shellexecute(handle,'Open'
It will use command (msdos) and excute php.exe.
See this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/createprocess.asp
and this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/creating_processes.asp