XModPro

GET or POST parameters - any flaws in this method?

Myron Weber Myron Weber asked Mar 28, 2018
Active Mar 29 · Viewed 2441 times
<p>Simple thing, and I think I have it solved. Posting here in case (1) there are any gaps that I haven't thought of or (2) it might help someone else. </p> <p>I have an existing page that is the catch-all manager screen for an issue-tracking system. So anywhere an issue can appear on any other page, it contains a &lt;xmod:redirect method="Post" ... &gt; link so the user can jump to this page. Except then I was asked "Hey, from these 2 pages, can you have the manager screen open in a new tab? And can that be done right away?" </p> <p>I thought of all the places I would need to change, and test, to change from using the Post to Get method. Then I had an IDEA! I changed the manager screen to accept either POST or GET parameters, that way I can change the 2 requested pages right away and deal with the rest later. It logically makes sense, it's crazy simple, and it's working. Is there any reason other than a desire for consistency why this POST/GET hybrid approach would not be recommended? </p> <p><strong>BEFORE</strong>: </p> <p>&lt;DetailDataSource CommandText="SELECT ... </p> <p>WHERE id = @id)"&gt; </p> <p> &lt;Parameter Name="id" Value='[[Form:id]]'/&gt; </p> <p> &lt;/DetailDataSource&gt; </p> <p><strong>AFTER:</strong> </p> <p>&lt;DetailDataSource CommandText="SELECT ... </p> <p>WHERE id = coalesce(@form_id, @url_id)"&gt; </p> <p> &lt;Parameter Name="form_id" Value='[[Form:id]]'/&gt; </p> <p> &lt;Parameter Name="url_id" Value='[[Url:id]]'/&gt; </p> <p> &lt;/DetailDataSource&gt; </p>

1 Answer

Loading answers...