summerterm-project21/register.php

12 lines
396 B
PHP
Raw Normal View History

2022-03-08 16:38:45 +00:00
<?php
$db_handle = pg_connect("host=localhost dbname=project user=postgres");
$query = "insert into emails(email) values ('$_POST[email]')";
$result = pg_query($db_handle, $query);
if ($result) {
echo 'Registered successfully.';
}
else {
echo 'Already registered.<br>If you are sure this is not the case then please contact the site administrator immediately.';
}
pg_close($db_handle);
?>