Results 1 to 1 of 1

Thread: start command alternative in exec ()

  1. #1
    Join Date
    Aug 2011
    Posts
    10
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default start command alternative in exec ()

    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:
    Code:
    <?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/');
    }
    ?>
    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 tried
    Code:
    header("Location: http://localhost/tez/test.php"); // OR
    system ("http://localhost/tez/test.php/"); // OR
    passthru ("http://localhost/tez/test.php");
    instead of
    Code:
    exec ('start 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.
    Thank you.
    Last edited by tuffy; 09-14-2011 at 07:31 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •