I am having a problem getting my script to continue processing after calling (request_once) another script.
There are three scripts involved.
Main one (Homes_add.php) calls the second (a_picts.php) which is a form validating script - which ofcourse calls its form (a_picts_fm.php)
Again - it is clear that the problem is not in returning from a_picts_fm back to a_picts - BUT the problem is returning from a_picts back to the main script ( homes_add script.)
I wonder if there is a fundamental structural problem ?
The main script (homes_add)
calls ( require_once ) the a_picts which processes the form.
The form itself on submisson re-runs the a_picts which when finshed should return to the main script (homes_add) and continue from where it left the off.
To summarise the problem is that the a_pict.php stops at the last line afer executing this :
echo " *** and got here";
IT DOESN'T RETURN TO HOMES_ADD.PRG
- dont know why ???
I have stripped a lot of the code to try and make it clearer.

If anyone can help solve this - I'd much appreciate it as I am a bit stuck !
HERE IS THE MAIN - HOMES_ADD.PHP SCRIPT
IT CALLS THE PICTURE HANDLING SCRIPT
PHP Code:
<?php
/*
* homes_add.php
*
* Called by : homes_ad_btn.php
*
* Call a_picts.php to get the pictures
*
* processes the homes_add_fm.php which is the
* FORM for adding a home.
*/
if (!isset($_POST['run_mn'])){
PREPARES DATA AND CALLS THE MAIN FORM ( NOT PICTURE FORM)
else { // BIG else - SO MAIN FORM HAS RUN
VALIDATES FORM DATA
/*
* Now we get the pictures.
*/
if( $pict == "y"){
require_once("a_picts.php"); // < -- HERE IS THE CALLING
exit(); // < -- I TRIES TAKING THIS OUT
} // endif
else{
$N_pix1=$N_pix2=$N_pix3=$N_pix4=$N_pix5="none";
} // end else
// I WANT TO RETURN BACK HERE
$sql = "UPDATE homes SET
pix1 = '$N_pix1',
pix2 = '$N_pix2',
pix3 = '$N_pix3',
pix4 = '$N_pix4',
pix5 = '$N_pix5'
WHERE ad_ref = '$A_ref' ";
mysql_query($sql)
or die("could not execute HOMES UPDATE PICTURES query");
/*
* Update the client table
*/
ETC ETC
} // end BIG else
?>
THIS IS THE SECOND SCRIPT THAT CALLS AND THEN PROCESSES
THE FORM
PHP Code:
if(isset($_POST['run'])){ // BIG IF
PROCESSES THE PICT_FM.PHP FORM
echo "got here";
} // end BIG IF
else {
$message1 = "none";
$message2 = "none";
require_once ("a_picts_fm.php"); // CALLS THE FORM
exit();
} // end else
echo " *** and got here"; // THIS WHERE IT STOPS
?>
AND THIS IS THE FORM THAT THE ABOVE REQUIRES
PHP Code:
<?php
/*
* picts_fm.php
*
* Called by : picts.php
* IT THEN GOES BACK TO PICTS.PHP
*
* FORM for adding images.
*
*/
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript">
<form name="main_fm" enctype ="multipart/form-data" action="a_picts.php" method="POST">
<input type = 'hidden' name='run' value="on">
<input type="hidden" name ="MAX FILE SIZE" value="500000">
<input type = 'hidden' name='adref' value="<?php echo $A_ref ?>">
<div style='position:absolute; left:40px; top:320px' >
<b>First image:</b><br />
<input type="file" size="50" id = "u1" name="upLoad1" onchange="showImg1()"><br />
<input type="text" size="50" id = "n1" name="fName1" readonly>
<input type="button" value ="Clear" onclick="document.main_fm.upLoad1.value='';document.main_fm.fName1.value='';document.getElementById('image1') .src='';document.getElementById('image1').style.display='none'">
</div>
<div style='position:absolute; left:500px; top:262px' >
<img height='160' width='160' id="image1" style='display:none' />
</div>
</form>
</body>
</html>