Jump to content

do javascript is absolutely required in order to notify users on action in another page


alexandre

Recommended Posts

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.  

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by alexandre
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.