mirror of
https://git.adityakumar.xyz/summerterm-project21.git
synced 2024-11-09 16:59:43 +00:00
12 lines
No EOL
396 B
PHP
12 lines
No EOL
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);
|
|
?>
|