Quantcast

Posting a form with a regular link

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Posting a form with a regular link

steveb805-2

HI All, I have this list of discussion posts that is accessed simply
by going to index.php under /posts/.

And currently, under each post I have a delete link ( of course it
only shows up if you're the user logged in, who also created those
posts, but that's an aside.).

It's just a regular text url link like: /index.php/posts/delete/
<post_id>

But now I decided I'm going to use the cakephp Security component, and
will now need to POST this form to the delete() action.

But the problem is that with a regular text link, you have to use
javascript.

The url will now need to be javascript:submitdelete();  which sets a
hidden form variable to the particular postid, and then calls
form.submit().

I'm wondering how many users have javascript disabled.

And wondering if anyone else went from having to go from get to post
and how you handled it .

TIA
Steve


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Posting a form with a regular link

Dr. Tarique Sani

On 9/22/07, beetlecube <[hidden email]> wrote:
>
> I'm wondering how many users have javascript disabled.

IME - this varies significantly from site to site my photogallery site
has <1% visitors with JS disabled where as my company site has about
5%

Why not have a submit button styled to look like a link - wrap the
whole thing in a <form>

T

--
=============================================================
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.com
=============================================================

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Posting a form with a regular link

the_undefined
I've started doing the following. If the "delete" action is called using GET then I'm serving a "Are you sure you want to delete item X?" page which has a form and a submit button to it. When JS is enabled then my "delete" link has an onclick event that pops up a JS confirm() modal and then sends out an AJAX POST.

This way you are protected from XSS while also having a very accessible site. If you want no confirmation then Tariques suggestion is the best solution.

-- Felix
--------------------------
My Blog: http://www.thinkingphp.org
My Business: http://www.fg-webdesign.de


Dr. Tarique Sani wrote:
On 9/22/07, beetlecube [hidden email] wrote:
  
I'm wondering how many users have javascript disabled.
    

IME - this varies significantly from site to site my photogallery site
has <1% visitors with JS disabled where as my company site has about
5%

Why not have a submit button styled to look like a link - wrap the
whole thing in a <form>

T

  

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Posting a form with a regular link

steveb805-2

Thanks for those ideas, once again.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Loading...