Page 1 of 1

Running php file from within script

Posted: Sat May 08, 2010 6:33 pm
by pizzipie
I'm trying to do what a form action 'file.php' does, that is run file2.php. Only run it from file1.php. I've tried exec(file2.php) and it doesn't work.
Please help

Thanks, R
<head><title>Accounts</title></head>

<body>";
echo $_POST['operation'], "<br>";

switch ($_POST['operation']) {
case "No Change/Exit": <<========== Is it possible to do this exec(ExitProgram.php) or somthing like this
exit("Bye Bye"); == or for that matter run any php script from another php script ==
break;
case "Revise This Account": ==== trying to get code to run from another page =====
echo "<br>Code to revise account goes here<br>";
break;
case "New Account":
echo "<br>Code to add new account goes here<br>";
break;
case "Delete This Account":
echo "<br>Code to delete this account goes here<br>";
break;
default:
exit("Bye Bye");
break;
}

Re: Running php file from within script

Posted: Sat May 08, 2010 6:37 pm
by John Cartwright

Re: Running php file from within script

Posted: Sun May 09, 2010 11:09 am
by pizzipie
SOLVED!!!

Thanks John, I thought there was a way. I have three or four reference books and just didn't stumble on the right solution.

R