Matthew Grimm wrote:
> I'd like to use PHP to execute PHP files sequentially.
> For example, I'd like to run one PHP file, then another and then a third.
> If I had access to a shell, I'd write a shell script to do it. But because
> the web server I'm using does not offer shell access, I'm hoping to find
> a way to do the same thing using PHP.
> But all I find are the execute and include functions, and they
> don't do what I need. Execute is not implemented on my server and
> include runs all files at once.
If execute is disabled, I would have one script instruct your browser to
load the next script once the execution is finished of the first.
Like so:
script1.php:
<?PHP
execute a bunch of code
......
echo('<head>
<meta http-equiv="refresh" content="0; url=script2.php">
</head>'); ?>
script2.php
<?PHP
execute a bunch of code
.....
echo('<head>
<meta http-equiv="refresh" content="0; url=script3.php">
</head>'); ?>
Never tried it but I think it should work. You can also pass variables
to the scripX.php file like scriptX.file?nextScript=5&more=info ...
let me know how it works.