Hello,
In a PHP file, I send the text in a textarea to another PHP file named test.php. The context sent to the test.php file is also PHP code. I want to execute test.php file and show the result to the user in another tab of the browser. The code is like this:
I do not want to use "start" command inside exec() to be platform independent. As far as I know, "start" command can only be used on Windows OS. I triedCode:<?php if (isset($_POST['kod_calistir'])){ $kod = $_POST['kod_yazim_alani']; // take text from textarea $fd = fopen("c:\\xampp\\htdocs\\tez\\test.php", "w+") or die("Can't open file $filename"); $fout = fwrite($fd, $kod); fclose($fd); exec ('start http://localhost/tez/test.php/'); } ?>
instead ofCode:header("Location: http://localhost/tez/test.php"); // OR system ("http://localhost/tez/test.php/"); // OR passthru ("http://localhost/tez/test.php");
but I was sucessless. Neither of the three did the same thing as exec-start code combination. Any suggestions will much be appreciated.Code:exec ('start http://localhost/tez/test.php/');
Thank you.



Reply With Quote
Bookmarks