Assuming that you have a controller called contents (pages is already
taken by Cake) and a view action that lets you view a given page, you
could try something like this:

http://www.testsite.com/contents/view/1/secretid/

In your controller, you could have this:

function edit($id=null, $secretid=null)

Now when someone goes to a page, you check first for the id to make
sure the id exists (standard procedure).  If the id exists, read that
record from the database.  Now check that record's secretid against
$secretid from the url.  If they don't match, or if none was supplied
(ie. it gets assigned to null if they don't put one in the url),
render a view page.  If they do match, show an edit page (you could do
this through switching, or you could redirect to an edit page).

I hope that helps!
hydra12

On Oct 15, 5:23 am, Cody Sortore <[EMAIL PROTECTED]> wrote:
> Okay, with the particular site I'm building I did a poll and received
> 80% feedback to make the site without a user log in system.  The
> problem is that I want to allow the creator editing access still.
> People make mistakes, or may need to delete spam comments
> occasionally.
>
> What I was thinking was to have a place when creating their page they
> put in a "secret id" that then goes into the database and what I want
> to do is so that the only way to access the edit page is to have that
> secret id in the url for example:
>
> http://www.testsite.com/pages/secretid/edit/1/
>
> I want to set it up so that the only way to edit the page would be to
> have the secret id in place... I can't figure it out at all though.  I
> did consider making it so that instead of the page number it just used
> the secret id, but that would be a bad idea because if two people had
> the same secret id which would it pull up?  And if I checked for
> unique id's it would have to be pretty long so that everyone could
> have something different.
>
> Any help or pointing in the right direction would be greatly
> appreciated!  Thanks in advance for the help!
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to