elentz Posted December 22, 2016 Share Posted December 22, 2016 I freely admit I am pretty green in alot of this stuff. I have a php page that runs arp-scan and returns information on MAC addresses for the network. It takes 10 seconds probably. I am looking for a visual indication to tell the user that the scan is in progress. I have no idea what this is even called. Can someone point me in the direction I need to go to figure this out? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/302805-page-busy-indicator/ Share on other sites More sharing options...
requinix Posted December 22, 2016 Share Posted December 22, 2016 Do the work during an AJAX request, not on a regular page load, and then you can do anything you want: message, spinning thing, busy cursor, whatever. Quote Link to comment https://forums.phpfreaks.com/topic/302805-page-busy-indicator/#findComment-1540706 Share on other sites More sharing options...
Jacques1 Posted December 22, 2016 Share Posted December 22, 2016 You cannot do this with PHP alone, because a long-running PHP script delays the entire response so that the user just sees a blank window. You need JavaScript. More specifically: You need to trigger the PHP script with Ajax. The spinning wheel is called a throbber, and there are plenty of libraries. When you've received the response, you hide the throbber and insert the data from the PHP script into the page (you should make the PHP script output JSON data rather than a plain string). Start with the Ajax part. Quote Link to comment https://forums.phpfreaks.com/topic/302805-page-busy-indicator/#findComment-1540707 Share on other sites More sharing options...
elentz Posted December 23, 2016 Author Share Posted December 23, 2016 Thanks for the direction guys! Quote Link to comment https://forums.phpfreaks.com/topic/302805-page-busy-indicator/#findComment-1540720 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.