Jump to content

[SOLVED] PHP passthru


tps2

Recommended Posts

Hi, quite new to this forum here - i wrote this bit of code to process the dos command to use the LITConvertDemo.exe with the .opf file and the .lit file.  The Dos Command required is

 

D:\oeat\mockup\csdk\CDemos\LITConvertDemo\Release\LITConvertDemo.exe "D:\oeat\mockup\upload\path\path\path.opf" "D:\oeat\mockup\upload\path\path.opf"

 

Where "path" equals $_SESSION['title']

<?php

  passthru(`"D:\oeat\mockup\csdk\CDemos\LITConvertDemo\Release\LITConvertDemo.exe".'

"D:\\oeat\\mockup\\upload'."\\".$_SESSION['title']."\\".$_SESSION['title']."\\".$_SESSION['title'].".opf"." "." ".'"D:\\oeat\\mockup\upload'."\\".$_SESSION['title']."\\".$_SESSION['title'].".lit".""`, $output2);

 

 

  echo("<h1> ATTEMPT 2 </h1>");

  echo "<pre>" . var_export($output2, TRUE) . "</pre>\n";

 

?>

 

But it doesn't work - think its a formatting error or something!! can anyone help?!

Link to comment
https://forums.phpfreaks.com/topic/51717-solved-php-passthru/
Share on other sites

Can anyone spot any formatting problems that occur in this code as It is returning $output2 as "1" instead of performing the process on the commandline

 

<?php passthru("D:\\oeat\\mockup\\csdk\\CDemos\\LITConvertDemo\\Release\\LITConvertDemo.exe".
"D:\\oeat\\mockup\\upload"."\\".$_SESSION['title']."\\".$_SESSION['title']."\\".$_SESSION['title'].".opf"."".
"D:\\oeat\\mockup\upload"."\\".$_SESSION['title']."\\".$_SESSION['title']."\\".$_SESSION['title'].".lit"."", $output2); ?> 

 

Look forward to your response

Link to comment
https://forums.phpfreaks.com/topic/51717-solved-php-passthru/#findComment-254854
Share on other sites

missing spaces

 

"D:\\oeat\\mockup\\csdk\\CDemos\\LITConvertDemo\\Release\\LITConvertDemo.exe".
" D:\\oeat\\mockup\\upload"."\\".$_SESSION['title']."\\".$_SESSION['title']."\\".$_SESSION['title'].".opf"." D:\\oeat\\mockup\upload"."\\".$_SESSION['title']."\\".$_SESSION['title']."\\".$_SESSION['title'].".lit"

Link to comment
https://forums.phpfreaks.com/topic/51717-solved-php-passthru/#findComment-254978
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.