summerterm-project21/register.php
2022-03-08 22:08:45 +05:30

12 lines
396 B
PHP

<?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);
?>