Ejemplo n.º 1
0
ini_set("display_errors", "On");
error_reporting(E_ALL & ~(E_STRICT | E_NOTICE));
// grab db class and connect
if (isset($_POST['submit'])) {
    require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/defines.php";
    require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/postgredb.php";
    $port = 5432;
    $persistent = 0;
    $db = new PostgreDB(FORMS_DATABASE, FORMS_HOST, $port, FORMS_USERNAME, FORMS_PASSWORD, $persistent);
    $db->Connect();
    $firstname = addslashes($_POST['firstname']);
    $lastname = addslashes($_POST['lastname']);
    $email = addslashes($_POST['email']);
    $sql = "INSERT INTO contacts (firstname,lastname,email) VALUES ('{$firstname}','{$lastname}','{$email}')";
    $db->ExecQuery($sql);
    $db->DBClose();
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Request Information</title>
<style>
body{
font-family:"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
}
p, h1, form, button{border:0; margin:0; padding:0;}
.spacer{clear:both; height:1px;}
/* ----------- My Form ----------- */
Ejemplo n.º 2
0
        ?>
<tr>
   <td align="center"><?php 
        echo $result["first_name"];
        ?>
</td>
   <td align="center"><?php 
        echo $result["last_name"];
        ?>
</td> 
   <td align="center"><?php 
        echo $result["age"];
        ?>
</td>
	<td align="center"><?php 
        echo $result["address"];
        ?>
</td>
 </tr>
		
		<?php 
    }
}
$dbdrv->Commit();
// Commit transaction
$dbdrv->DBClose();
// Close connection with database
?>
 
 
</table>