alexandre Posted October 24, 2022 Share Posted October 24, 2022 i was wondering if there would be a way to notify users and make actual changes to the database, without the users having to actualy go on the page where the action is taking place. example i have this donation event that works in link with a timer and when that timer is at zero, it should update all the winners balances and other stats needed to be updated but i am afraid that i wont be able to do so only using php. i really wanted to avoid using javascript as much as possible so this is the reason why i wanna try to find every other alternative to ajax before resigning to force users to activate something that some wont want to. i personaly always disable javascript when i am using my browser so i dont see why i would force others to do so... if anyone knows an alternatie it would be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/315451-do-javascript-is-absolutely-required-in-order-to-notify-users-on-action-in-another-page/ Share on other sites More sharing options...
ginerjm Posted October 24, 2022 Share Posted October 24, 2022 NOt sure I follow what you are wishing to do. Perhaps you would like a task that runs at a certain time each day or hour that gathers some data from previous actions that have happened and updates a db with that info. If that is what you are saying have you thought about setting up a cron job? Quote Link to comment https://forums.phpfreaks.com/topic/315451-do-javascript-is-absolutely-required-in-order-to-notify-users-on-action-in-another-page/#findComment-1601886 Share on other sites More sharing options...
requinix Posted October 24, 2022 Share Posted October 24, 2022 If you want something to change on the page after the user has loaded it, and without the user having to do anything like reload the page, then you have to use Javascript. Quote Link to comment https://forums.phpfreaks.com/topic/315451-do-javascript-is-absolutely-required-in-order-to-notify-users-on-action-in-another-page/#findComment-1601889 Share on other sites More sharing options...
alexandre Posted October 29, 2022 Author Share Posted October 29, 2022 On 10/24/2022 at 7:00 PM, requinix said: If you want something to change on the page after the user has loaded it, and without the user having to do anything like reload the page, then you have to use Javascript. ok thank you, i am indeed trying to make example : the user balance updating if an event is starting and they are not logged on or on another page than the actual event page. Quote Link to comment https://forums.phpfreaks.com/topic/315451-do-javascript-is-absolutely-required-in-order-to-notify-users-on-action-in-another-page/#findComment-1602002 Share on other sites More sharing options...
alexandre Posted October 29, 2022 Author Share Posted October 29, 2022 On 10/24/2022 at 2:27 PM, ginerjm said: NOt sure I follow what you are wishing to do. Perhaps you would like a task that runs at a certain time each day or hour that gathers some data from previous actions that have happened and updates a db with that info. If that is what you are saying have you thought about setting up a cron job? thank you for the advice i will look into what is cron job. Quote Link to comment https://forums.phpfreaks.com/topic/315451-do-javascript-is-absolutely-required-in-order-to-notify-users-on-action-in-another-page/#findComment-1602003 Share on other sites More sharing options...
alexandre Posted October 29, 2022 Author Share Posted October 29, 2022 i was wondering if it would be possible or even too annoying for the user to force a redirection to where the action is taking place. this way if an event is starting, the user could maybe get notified of the imminent redirection and then have a choice to close the popup to cancel the redirection if they wish to finish something they was doing in the moment. i noticed that for the first events i coded , it seem to be made in a way that, only when the user visit the event page, the database gets updated. by that i mean that even if i refresh when i am in the profile page the statistics supposed to be updated doesnt actualy upate until the user go to the event page. Quote Link to comment https://forums.phpfreaks.com/topic/315451-do-javascript-is-absolutely-required-in-order-to-notify-users-on-action-in-another-page/#findComment-1602004 Share on other sites More sharing options...
alexandre Posted October 29, 2022 Author Share Posted October 29, 2022 (edited) 16 minutes ago, alexandre said: i was wondering if it would be possible or even too annoying for the user to force a redirection to where the action is taking place. this way if an event is starting, the user could maybe get notified of the imminent redirection and then have a choice to close the popup to cancel the redirection if they wish to finish something they was doing in the moment. i noticed that for the first events i coded , it seem to be made in a way that, only when the user visit the event page, the database gets updated. by that i mean that even if i refresh when i am in the profile page the statistics supposed to be updated doesnt actualy upate until the user go to the event page. i am kinda slow to understand but i think my issue here except for the automatic refresh issue. my problem with the database not actualizing on refresh is simply that i did not separate my script , i should have made a script only on server side processing the winners rows instead of doing it on the actual event ranking page. Edited October 29, 2022 by alexandre Quote Link to comment https://forums.phpfreaks.com/topic/315451-do-javascript-is-absolutely-required-in-order-to-notify-users-on-action-in-another-page/#findComment-1602005 Share on other sites More sharing options...
alexandre Posted October 29, 2022 Author Share Posted October 29, 2022 On 10/24/2022 at 2:27 PM, ginerjm said: NOt sure I follow what you are wishing to do. Perhaps you would like a task that runs at a certain time each day or hour that gathers some data from previous actions that have happened and updates a db with that info. If that is what you are saying have you thought about setting up a cron job? i was looking at this cron jobs and i dont think it would be useful for what i have in mind, since there is a limitation of 60 sec as shortest interval betweens each jobs. if i see my platform as a high traffic website. users wont be limited in time between each transaction they want to do so, i dont think it would work. but for other things it might come in handy. Quote Link to comment https://forums.phpfreaks.com/topic/315451-do-javascript-is-absolutely-required-in-order-to-notify-users-on-action-in-another-page/#findComment-1602006 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.