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"
<[email protected]> 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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to