title: Golang, not passing values from HTML
body: <p>I am trying to build a simple, two-<code>Handler</code> web server. In the first handler, I am pulling values from two fields, a user's first name and last name. In the second handler I am simply stating, <code>"Hello" (first name, last name)</code>.</p>
  
  <p>I've put an <code>fmt.Println</code>, and it seems that I'm not correctly pulling the info from the first <code>Handler</code> back into the Go programming. Where is this going wrong?</p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "html/template"
      "log"
      "net/http"
  )
  
  type Field struct {
      Firstname  string
      Secondname string
  }
  
  func RootHandler(w http.ResponseWriter, r *http.Request) {
      tmpl, err := template.ParseFiles("index.html")
      if err != nil {
          fmt.Println("Index Template Parse Error: ", err)
      }
      err = tmpl.Execute(w, nil)
      if err != nil {
          fmt.Println("Index Template Execution Error: ", err)
      }
  
  }
  
  func main() {
      http.HandleFunc("/", RootHandler) // sets router
      http.HandleFunc("/welcome", WelcomeHandler)
      err := http.ListenAndServe(":4000", nil) // set listen port
      if err != nil {
          log.Fatal("ListenAndServe: ", err)
      }
  }
  
  func WelcomeHandler(w http.ResponseWriter, r *http.Request) {
  
      Firstname := r.FormValue("Namef")
      Secondname := r.FormValue("Namel")
      fmt.Println(Firstname)
  
      f := new(Field)
      f.Firstname = Firstname
      f.Secondname = Secondname
      fmt.Println(*f)
      tmpl, err := template.ParseFiles("tmpl/welcome.tmpl")
      if err != nil {
          fmt.Println("Index Template Parse Error: ", err)
      }
      err = tmpl.Execute(w, &amp;f)
      if err != nil {
          fmt.Println("Index Template Execution Error: ", err)
      }
  
  }
  </code></pre>
  
  <p>And here is the <code>index.html</code> that I'm pulling the two values from:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  
  &lt;form action="/welcome" method="post"&gt;
  &lt;p&gt; Welcome! First I will need your full name: &lt;/p&gt;
  First Name: &lt;input type="text" id="Namef" name="FirstName"&gt;&lt;br&gt;
  Last Name:  &lt;input type="text" id="Namel" name="LastName" &gt;&lt;br&gt;
  &lt;input type="submit" value="Next"&gt;
  &lt;/form&gt;
  
  &lt;p&gt;Click the "Submit" button and the form-data will be sent to a page on the server called "demo_form.asp".&lt;/p&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>