Skip navigation
Currently Being Moderated

refresh the page when you enter, you load, or focuses

Feb 7, 2014 1:29 AM

Tags: #update #refresh #css6 #on_focus
Greetings to the community...

 


The question I have is like to refresh (update) a page when you enter...


On the "results.php" page data received from a database I have and when I modify them from another page "modify.php" and return to the "results.php" changes are not seen until pulse update


How can be so it is updated each time that is recharging, you enter, or focuses the page?


Thanks in advance.

 
Replies
  • Currently Being Moderated
    Feb 7, 2014 12:43 PM   in reply to ivals

    I am told that if you link back to the page with a question mark after the pagename in the link, you will get a refresh of that page. In other words, assuming you are returning to the results page with a php header() command, you would do this -

     

    header("Location: http://www.example.php/results.php?");

     

    I have not tried this but it sounds like it might do what you need. Alternatively, you could try it with a dummy variable there, like this -

     

    header("Location: http://www.example.php/results.php?dummy=0");

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 7, 2014 3:59 PM   in reply to ivals

    Try this -

     

    $updateGoTo = "modify.php?dummy=0";

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 7, 2014 4:01 PM   in reply to MurraySummers

    Or, you could try -

     

    $updateGoTo = "http://www.example.com/modify.php?";

     

    Where you replace 'www.example.com' with your actual domain name.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 7, 2014 4:47 PM   in reply to ivals

    >I go back to the page

     

    Are you using the back button to go back? That will typically show a cached page. There are various methods to not cache the page, but the simplest thing to do is just redirect back to the results page and not use the back button.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 10, 2014 3:24 PM   in reply to ivals

    >If it is what I try to do, but when redirect it to

    > the main page, I get the functions and styles.

     

    I'm not sure what you are saying. Can you try to clarify?

     

     

    >Tell me that there are several ways, could you teach me some.

     

    I'm not sure I understand the workflow. When I tried to edit a record and hit the update button, I was directed to another page. What is that page used for?

     

    Once the user clicks the submit button on the update form, where do you want them to be directed to? The list, or a view of the updated record?

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 11, 2014 10:11 AM   in reply to ivals

    Yes, I have already gone through that. What is not clear is if you intended to stay on the update page after the update, or return to the master list. In any case, we'd need to see the code in modificarTodoBUENO.php to be able to troubleshoot the problem.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 11, 2014 2:58 PM   in reply to ivals

    OK, a few things aren't making sense to me. In your Update code block, you have a redirect set to go back to the list page after the database is updated:

    $updateGoTo = "./informe.php?dummy=0";

    and then

    header(sprintf("Location: %s", $updateGoTo));


    Yet, when I click the update button, it does not go there. It stays on the update page. Are you sure the code you posted is the same code on your site?

     

    Next, although it stays on the update page, the details are not displayed - yet the record details ARE there in the page source! So that seems like some sort of rendering issue.  I would comment out all of the javascript calls for now to see if they are interfering with the page rendering.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 11, 2014 3:46 PM   in reply to ivals

    > (you can look at it with the

    > option of Ctrl+u (Firefox/Chrome)

     

    No, you can't. Server side code is not sent to the browser. It is executed on the server.

     

    >and if that me forward to the previous page. But the results are not seen

     

    Yes, I understand that. But if you look at the browser source code for the page where the results are not seen, you will see the results are there! Did you comment out the references to the .js files as well as the external counter?

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 11, 2014 6:28 PM   in reply to ivals

    >All the .js??

     

    Yes, for now. Your site is currently down completely or I would show you exactly which lines, but for now just get rid of all of it.

     

     

    >And which is the external counterr?

     

    Your page contains a link to some stats counter. Remove that as well.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 11, 2014 7:01 PM   in reply to ivals

    Yes, that looks fine. But as I said, your site appears to be down. I can not reach it at the moment.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points