First, you still haven't put any html commands into submit.php. What are you expecting the browser to do when it receives simple text? Add the html, head and body tags appropriately.

Second, you're passing the wrong values to the connect function. The three values are location ('localhost', since it's running on the same server as the php program), username (which in your original example was 'root'), and password. What user/password did you define when you created the database?

So if your database is named 'db' and the fields in table 'table' are named 'name' and 'password', then you should be good to go.