BigD Posted August 22, 2012 Share Posted August 22, 2012 Is there a function that will stop PHP script and resume when viewer pressed enter key? Link to comment Share on other sites More sharing options...
BigD Posted August 22, 2012 Author Share Posted August 22, 2012 I have a loop, each time through the loop I create a web page, pause for viewer to print using File > Print. When viewer presses enter I want to resume. How can this be done? A better way would be have a print button, when pressed it will print the web page. How can this be done? Link to comment Share on other sites More sharing options...
niche Posted August 22, 2012 Share Posted August 22, 2012 Put the php you want to display in a javascript alert(). Link to comment Share on other sites More sharing options...
justsomeguy Posted August 22, 2012 Share Posted August 22, 2012 It doesn't make sense to have PHP respond to user interaction like that on a web site, that's not how PHP works on a web server. If you want to build a desktop application with PHP then you can have it respond to user input, but that model doesn't make sense when a web server is involved. Javascript responds to user input, not PHP. You can use window.print in Javascript to show the print dialog. 1 Link to comment Share on other sites More sharing options...
niche Posted August 22, 2012 Share Posted August 22, 2012 I wouldn't have done it that way either, but I was unaware of the distinction as I've only used that php/js routine for debugging. I know better now. Thanks jsg. Link to comment Share on other sites More sharing options...
BigD Posted August 22, 2012 Author Share Posted August 22, 2012 What I plan to create is both for web server and desktop. Info are stored for a training school in MySQL DB, Students can check their records through web server. School administrators can do backend records update through desktop application. I thought most web sites operate like that. It has 2 sides. store front is for customers, backend is for store clerks. Am I incorrect? Link to comment Share on other sites More sharing options...
justsomeguy Posted August 22, 2012 Share Posted August 22, 2012 When I refer to desktop software, I'm talking about a .exe file (for Windows anyway) that you double-click to run. That's not what PHP running on a web server is like for people accessing it through a browser. I've never created a compiled backend for my clients, they always log in through a browser to manage their site. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now