Handle the registration form

Well, just log it for now.
This commit is contained in:
Eli Ribble 2025-11-04 23:21:13 +00:00
parent 214588ba83
commit ebb55556d2
No known key found for this signature in database
3 changed files with 23 additions and 4 deletions

View file

@ -1,6 +1,7 @@
package main
import (
"log"
"net/http"
)
func getFavicon(w http.ResponseWriter, r *http.Request) {
@ -21,3 +22,20 @@ func getSignup(w http.ResponseWriter, r *http.Request) {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
}
func postSignup(w http.ResponseWriter, r *http.Request) {
if err := r.ParseForm(); err != nil {
log.Printf("Error parsing form: %v", err)
http.Error(w, "Failed to process form", http.StatusBadRequest)
return
}
email := r.FormValue("email")
name := r.FormValue("name")
terms := r.FormValue("terms")
log.Printf("Signup - Email: %s, Name: %s, Terms: %s", email, name, terms)
w.WriteHeader(http.StatusOK)
w.Write([]byte("Form received"))
}