| linux & php execution problem I have a code in PHP that executes the linux command . the syntax and concept are correct & even by the command that we are using we get output if we run it in terminal . Can anyone suggest the fault in the code.
the code is:
<?php
echo "hi its me lalit kumar mishra";
$t1=$_GET['t1'];
print("<br><br>");
echo "value of file name is $t1";
print("<br><br>");
$currentdir="/home/wipro";
$t2=$t1;
$t2 .= '.o';
$j="cd ".$currentdir."; gcc -DNDEBUG -o $t2 $t1 2>&1";
echo "$j";
print("<br><br>");
shell_exec($j);
$m="/home/wipro/./$t2";
$var3=shell_exec($m);
echo "compile = $var1";
$msg="lalit msg";
print("<br><br>");
print("<br><br>");
echo "output = $var3";
print("<br><br>");
print("<br><br>");
?> |