I have a button which generates a word document by changing the location of the page using javascript to my php script which outputs the file on the same page as the location was changed by using:
header(\'Content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.document\');
header(\'Content-Disposition: attachment; filename=\"\' .$templateName . \'.docx\"\');
readfile( $tempFileName);
Anyways, when I click the button, the php script changes alters a row of data which the page which contains the button harbours. Once the button is clicked, it just generates the word document but does not refresh the page and so, the user will think the button had only the effect of generating the word document but not changing the record and only after refreshing the page will the user notice the difference the button made.
My button\’s HTML is as such:
<input type=\"button\" value=\"Generate Final Demand\" onClick=\"self.location=\'DOCXGenerateDocument.php?templ=finaldemand&invoiceid=<?=$_GET[\'id\']?>\'\">
Have any ideas on how I can accomplish the task of refreshing the page once the document has came back?





Rating:
The post php – Refresh page after button was clicked and location changed appeared first on Javascript ASK.
via Javascript ASK http://javascriptask.phpfogapp.com/php-refresh-page-after-button-was-clicked-and-location-changed.html
No comments:
Post a Comment