Refresh

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
negblo
Forum Newbie
Posts: 19
Joined: Fri Jun 06, 2003 1:17 pm

Refresh

Post by negblo »

How would get a page to refresh upon re-entry....

lets say,

i select a Department, and then click the Edit button which takes me to a new page to edit the Department that was selected. After i edit the Department, and then click my submit button so that the changes take place, how do i get the Edit page to send me back to the first one and refresh it so the new changes are now visible...

I can, and have been, just click the refresh button, but to users checking the page, they might not know this... so i want to do it for them..

any ideas????!!!!!



Thanx-a-mil

negblo
User avatar
trollll
Forum Contributor
Posts: 181
Joined: Tue Jun 10, 2003 11:56 pm
Location: Round Rock, TX
Contact:

Post by trollll »

If you include the following in the head of the HTML for the page to get edited, it should take care of that:

Code: Select all

<meta http-equiv="cache-control" content="no-cache" />
Also, if you keep track of the page the user had visited when they clicked "edit" you can send the user back to that page using a

Code: Select all

header("location:first_page.php");
once everything has gone through okay.
negblo
Forum Newbie
Posts: 19
Joined: Fri Jun 06, 2003 1:17 pm

Post by negblo »

okay, let me see if i got this::

Code: Select all

<meta http-equiv="cache-control" content="no-cache" />
should go on the Edit.php page itself, all i am editing is a name..


and ::

Code: Select all

header("location:first_page.php");
goes where? and on what page? Admin= first page and Edit=second page



Thanx-a-mil

negblo
slick
Forum Newbie
Posts: 3
Joined: Wed Jun 18, 2003 11:52 am
Location: Ireland

Post by slick »

Just as an extra aside, if you really want to prevent caching, duplicate the no-cache header at the end of the HTML page as well.

See http://support.microsoft.com/default.as ... bContent=1 and http://support.microsoft.com/default.as ... bContent=1 for more info.
User avatar
trollll
Forum Contributor
Posts: 181
Joined: Tue Jun 10, 2003 11:56 pm
Location: Round Rock, TX
Contact:

Post by trollll »

Code: Select all

<meta http-equiv="cache-control" content="no-cache" />
...would go into the HTML head of the page that needs to get refreshed after the person edits the info (the Admin page, I believe). Then you would just stick the following PHP function after whatever PHP code processes the actual request (Edit?).

Code: Select all

header("location:first_page.php");
Hope that helps! :)
negblo
Forum Newbie
Posts: 19
Joined: Fri Jun 06, 2003 1:17 pm

Post by negblo »

thanx that does help, alot....



Thanx-a-mil

negblo
Post Reply