On 2005-09-23, Mark Stosberg <[EMAIL PROTECTED]> wrote:
> This morning I noticed that robots had been following "add to cart"
> links that I created. Oops.
>
> I know. Someone out there is thinking my application should have been
> more RESTful and used POST instead of GET for the add to cart links.
>
> Ok. I buy in now. But POSTing seems like a pain. Is there an easier way?
>
> Here's an equivalent of what I do now:
>
><a href="script.cgi?change_state=1"><img src="add.jpg"></a>
>
> To POST, I guess it would be like this:
>
><!-- Some extra CSS is also need to surpress the extra space that the <form>
>tag adds -->
> <form method="POST" action="script.cgi">
> <input type="hidden" name="change_state" value="1">
> <input type="image" src="add.jpg">
> </form>
>
> I tried approaching it from another angle to see if robots.txt could
> include query strings, and I couldn't find that does.
>
> Are there some better alternatives out there?
I just thought of this idea:
When building a new application, the processing run modes could be
handled by their own instance script.
script-get.cgi
script-post.cgi
The scripts could even be identical, as long the developer was
consistent about only using "script-post.cgi" for things that should
really be POSTs if it wasn't such a PITA.
Then robots.txt could be used to easily exclude "script-post.cgi".
Mark
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[email protected]/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]