Think carefully about where you are needing the help.
The forms just send the data to php <-- there are lots of tutorials for that
PHP sends the data to postgres <-- if you can't find a form find a class which does it and learn from the code - even if you rewrite it.
One good trick is to build you sql statement into a variable eg
$sql = "insert into mytable (id, name, age) values (null, '$name', '$age')";
then you can echo out $sql and copy into the postgres front end and check that your code will work.
That proven you can then use php to run the sql statement - using the class, your code etc.