Jimity Posted September 11, 2015 Share Posted September 11, 2015 Hi All, This is related to a previous post I have made in that its got to do with the same solution. I have an HTML form with a PHP backend. The form takes in user data, and the PHP takes that data as variables and populates a series of source HTML files etc (which includes the same image files universally) where placeholder variables are located. These source files are copied from a source template location in order to keep things simple. Essentially its so I can create a customised HTML solution (with embedded images) for each specific end-user. On a Windows Browser client the customised solution and its source files are placed in an archive and pushed to the end-user as a download for them to then process locally on the Windows client. At the end of the download, all the customised source files, and the archive, are deleted. Thsi works 100% as intended. I also need to take into account non-Windows clients though. On clients such as iOS/MacOS/Android I currently have the customised HTML solution displaying to the end user directly in the browser (its a stepping stone towards a better solution later down the road). I then complete some cleanup work to remove the customised source files (which have been copied from a source template location as well). The problem I am having is.: The HTML file displays within the browser as intended. Unfortunately though the embedded image within this HTML file is not displaying. I've worked out its essentially because the HTML file and its source files (which includes the embedded image file) are being deleted as part of my cleanup work at the end of my PHP. Whilst the HTML file displays on the end users browser in time before this cleanup work, the image file is being deleted before the browser essentially receives it to be displayed, creating an empty box on the HTML where the image should be. Can anyone help me with some coding that could essentially delay the start of my cleanup work in the script until the HTML file and its embedded image have been loaded on the end-users' browser ? I've tried sleep() commands, flush() commands, and ob_flush() commands without any success. Quote Link to comment Share on other sites More sharing options...
Jimity Posted September 12, 2015 Author Share Posted September 12, 2015 Not to worry. I fixed it. I've added some PHP coding to prevent caching. Combined with one or two sleep commands to stretch things out a bit, it shows the embedded image in the html whilst deleting the customised source files. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.