I always do simple - if you have link "/bookmarks/save" for AJAX it
should be "/bookmarks/save?".rand(), or my captcha images have URL "/
captcha/".rand() - concrete implementation depends on case, but idea
is in keeping URL of AJAX-dependent action always unique.

But surprised that you got this in FF. In my case only IE was
uncontrollable by headers (pragma no-cache, expires, etc).

On May 20, 11:22 pm, "Dave Maharaj :: WidePixels.com"
<d...@widepixels.com> wrote:
> Thanks for the tip but I do not seem to follow you on
> "If yes, only addition of any random param to form action (or whatever you
> request on "save" click) will save you."
>
> The function has no form...pretty much just a quick save "bookmark". All the
> saved data is gathered from the Auth id and the variable passed in the URL
> link in the controller.
>
> How would I implement the idea you mention?
>
> Thanks,
>
> Dave
>
> -----Original Message-----
> From: Dr. Loboto [mailto:drlob...@gmail.com]
> Sent: May-20-09 12:58 PM
> To: CakePHP
> Subject: Re: If not Ajax request
>
> I almost can swear that you tested it in IE and after save no actual request
> to server was done at all (can be checked in Apache access
> logs) - you saw cached result of previous save call. If yes, only addition
> of any random param to form action (or whatever you request on "save" click)
> will save you.
>
> On May 20, 9:28 pm, "Dave Maharaj :: WidePixels.com"
> <d...@widepixels.com> wrote:
> > I am trying to make sure the requested function is Ajax, if not
> > redirect...so if someone tries to manually enter it into the url it
> > redirects them back to the index page but not working the way i want.
> > This is what happens:
> > Scenario 1:
> > original URL: localhost/testsite/journal/256 If someone goes to the
> > page, clicks save (save entry 256)...perfect...works.
> > But if they then type in "entries/" into the url so it looks like
> > localhost/testsite/journal/entries/256 it runs the Ajax function.
>
> > Scenario 2
> > If they go to the same page localhost/testsite/journal/256 and type in
> > "entries/" into the url so it looks like
> > localhost/testsite/journal/entries/256  before saving an entry the
> > function re-directs as it should.
>
> > Why is it only redirecting for scenario 2 and not 1?
>
> > function entries($articles_id)
> >       {
>
> >           if ($this->RequestHandler->isAjax())
> >         {
>
> >             save entry code....
>
> >           }else{
> >           //request is not AJAX
> >           $this->redirect(array('controller' => 'journal', 'action' =>
> > 'index'));
> >         }
> >       }
>
> > Dave
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to