0

I have a php file that almost work properly. But then it wouldn't refresh the page everytime the admin clicks the approve/notapprove link. so here's the thing:

when an IT upload a file to the page, the file could be seen by the admin(who checks the uploaded file and decides whether the uploaded file is accepted or not). here's the thing, the admin is given a new table column for the approve and not approve, when the admin clicks on the approve link, the database is updated and same goes with the NotApprove link. the only difference between the two is the content (Approve, the other NotApprove). all codes works properly except for one thing,when you click on the link once, it wont reload,although it is updated on the first click.

is there a way to fix these? or is there anyway to refresh the page without causing problem to the update/delete links? i have tried the onclick = "opener.location.reload()" locaed inside my links. the page reloads when you click on the link but the data does not update.

thank you for those who help :)

NOTE** case solved but thanks for the help :)

MisaChan
  • 279
  • 1
  • 5
  • 15
  • "is there any way for us to debug your code without seeing it?" Not really. Post the relevant snippets of your code. – richsage May 12 '11 at 08:11
  • http://stackoverflow.com/questions/5973760/how-to-change-hyperlink-behavior-from-double-click-to-single-click/5973818#comment-6893794 my code could be seen here, i posted a question earlier. – MisaChan May 12 '11 at 08:14
  • `it wont reload`, probably there is a hash `#` on the link that prevents it from reloading that may be caused by initial clicking? e.g. `index.php?yes=100#` – tradyblix May 12 '11 at 08:18
  • i checked my whole page, and it does not have any hash on it :( – MisaChan May 12 '11 at 08:21
  • do you intend to display both `approve` and `not approve` at the same time? or let's say if it's not approved yet, should display 'approve' vice versa? – tradyblix May 12 '11 at 08:30
  • Both approve and not approve appear at the same time, both contains different function since when a user clicks on the approve, the content of the confirmation column in the table becomes "Approved" from "Pending". same goes to not approve – MisaChan May 12 '11 at 08:41

2 Answers2

1

Your problem might have something to do with the page not being refreshed and the browser showing a cached version. Try adding some headers:

<meta name="pragma" content="no-cache" />

or add an expire date in the past:

<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
Prikkeldraad
  • 1,347
  • 9
  • 14
0

you may have cached version, so while loading the page when passing parameter add one random number as parameter which should generate from javascript. That will ignore the cache and load the fresh content as passing your values.

The alternate method is using AJAX to do the same task (here too you should use random number as parameter to avoid cache).

AjayR
  • 4,169
  • 4
  • 44
  • 78
  • i am not familiar with ajax sir Ajay, and i also am a not so rookie programmer :( im sorry if i dont get your reply meant – MisaChan May 12 '11 at 08:25