diff --git a/src/new_client.c b/src/new_client.c index be5a65a..fd2002f 100644 --- a/src/new_client.c +++ b/src/new_client.c @@ -67,7 +67,8 @@ int cgiMain() { char *message; - if (cgiFormSubmitClicked("login") == cgiFormSuccess) { + if (cgiFormSubmitClicked("login") == cgiFormSuccess && + !strcmp(cgiRequestMethod, "POST")) { message = validate_credentials(); } else { message = ""; diff --git a/src/view_comments.c b/src/view_comments.c index 46b8695..802e868 100644 --- a/src/view_comments.c +++ b/src/view_comments.c @@ -238,7 +238,8 @@ cgiMain() fprintf(cgiOut, "\n"); - if (cgiFormSubmitClicked("submit") == cgiFormSuccess) { + if (cgiFormSubmitClicked("submit") == cgiFormSuccess && + !strcmp(cgiRequestMethod, "POST")) { handle_submitted_comment(); }