Internal Server Error using multiple includes

I have 8 files each of which adds 100,000 lines to my sql database table

Each file works OK when run individually, however when I try using includes to run as a batch it stops halfway through second file
500 >:(
End of script output before headers

here’s the script

<?php set_time_limit(0); include('1.php'); echo "Uploaded Section 1
"; include('2.php'); echo "Uploaded Section 2
"; include('3.php'); echo "Uploaded Section 3
"; include('4.php'); echo "Uploaded Section 4
"; include('5.php'); echo "Uploaded Section 5
"; include('6.php'); echo "Uploaded Section 6
"; include('7.php'); echo "Uploaded Section 7
"; include('8.php'); echo "Uploaded Section 8
"; echo"Uploads complete"; ?>

any ideas

try to run it as multiple requests

so do something like this , it’s more of a concept, try it out and see how it works.

if you want to echo out live status messages “uploaded section x” you could use javascript and ajax calls to run the server side php, and just print out statuses as javascript receives the response.

[php]<?php
set_time_limit(0);
$step = !empty($_GET[‘step’]) ? (int) $_GET[‘step’] : 1;
$filename = $step . ‘.php’;

if(file_exists($filename)) {
include($filename);
header('Location: ’ . $_SERVER[‘PHP_SELF’] . ‘?step=’ . ++$step);
exit;
}

echo"Uploads complete";[/php]

Thanks so much for that
I’ll try it out and get back to you
Thanks again…appreciate it

Sponsor our Newsletter | Privacy Policy | Terms of Service