Is this the best way to do this? Forms help

Soldato
Joined
1 Feb 2006
Posts
8,188
Hi, I am trying to write a page which will allow me to edit a number of posts from a database.

When the page loads it lists all the recent articles and generates an edit button beside the post content.

When this button is clicked it sets a POST variable on the form which posts to self. If this post variable exists then it will generate a form to enter/modify the content.

Is it best to do this using POST variables on what is the best practice here? Or is it better to use a GET parameter to control what article you want to edit?

Thanks
 
Last edited:
Anyone able to recommend a way of doing this? Is it safe to use a GET parameter for this particular task? The user could change the url but there is a session check at the top of the page to ensure that users can only open articles that they created.
 
always use post for sending data.

get has a limit iirc, and will show up on history which can produce some errors (ie, someone starts typing a url, sees an autocompleted one, clicks enter then auto updates a post to something. if that makes sense)

if its just a case of something like (if using get) ...php?id=post_id&edit=true, it doesn't really matter though (as long as on that page you use post to submit the data)
 
Back
Top Bottom