te7 Posted December 4, 2014 Share Posted December 4, 2014 I have a Php application that already has 2 buttons with input on the index page that perform some functions and output to different Php pages. Works good. How do I add a button with no input that would just perform a function and then just display a popup window showing the contents of a text file? I want to add several of these buttons for different functions and just display the contents of the resulting text files in popup windows. Any help would be greatly appreciated. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/292884-create-button-for-popup-window-to-display-contents-of-text-file/ Share on other sites More sharing options...
CroNiX Posted December 4, 2014 Share Posted December 4, 2014 So I'm assuming the text file you want viewed is on the server and not part of the current page? If so you'd want to use AJAX in conjunction with a MODAL window. Click the button, it fires off an ajax request to the server to retrieve the specified file, when the retrieved info is sent back to the browser display it in a MODAL popup window. This can only be done using javascript and I'd recommend using jQuery if you aren't already. Quote Link to comment https://forums.phpfreaks.com/topic/292884-create-button-for-popup-window-to-display-contents-of-text-file/#findComment-1498548 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.