You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.0 KiB
45 lines
1.0 KiB
<html>
|
|
|
|
<body>
|
|
|
|
|
|
<?php
|
|
require_once("connection.php");
|
|
require_once("gatewayNews.php");
|
|
require_once("gatewayAdmins.php");
|
|
|
|
$user= 'jeducourth';
|
|
$pass='achanger';
|
|
$dsn='mysql:host=localhost;dbname=dbjeducourth';
|
|
|
|
$title="titre";
|
|
$description="descirption du titre";
|
|
$pubdate="2022-04-12 8:8:8";
|
|
$link="exemple.com";
|
|
|
|
try{
|
|
$con = new Connection($dsn,$user,$pass);
|
|
$gateNews = new GatewayNews($con);
|
|
$gateNews->addNews(new News($title,$description,$pubdate,$link));
|
|
$gateAdmin = new gatewayAdmin($con);
|
|
|
|
$gateAdmin->addAdmin(new admin("toto","tata"));
|
|
|
|
|
|
/*$results=$gateNews->getNews();
|
|
Foreach ($results as $new){
|
|
print $new->getTitle()."<br>".$new->getDescription()."<br>".$new->getPubDate()."<br>".$new->getLink()."<br><br>";
|
|
}*/
|
|
require("listeNews.php");
|
|
|
|
|
|
}
|
|
catch( PDOException $Exception ) {
|
|
echo 'erreur';
|
|
echo $Exception->getMessage();
|
|
}
|
|
?>
|
|
|
|
</body>
|
|
</html>
|