使用另一种形式的ajax响应中的变量?

I have a form (index.php) that successfully uploads an image file to a server using jquery ajax. On success, a response is returned from the server (response.php)that echo's back the image that was just uploaded. I now want to add the $file_name variable to a second form on index.php. Whilst I can echo out the $file_name I cannot get it to appear in the form. Can anyone point me in the correct direction to achieve this?

response.php

echo '<h3>Preview</h3>';
//output thumbnails
foreach($responses["thumbs"] as $response){
    echo '<img src="'.$config["thumbnail_destination_folder"].$response.'" class="thumbnails" />';
}
//Echo file_name of image
foreach($responses["thumbs"] as $file_name):
    echo "File Name is".$file_name;
endforeach;

Second Form on index.php

<form action="" method="post" enctype="multipart/form-data" id="details_form">
    <input name="file_name" value="<?php echo $file_name;?>">
    <button type="submit" name="submit">Submit</button>
</form>