source modif

master
Jeremy DUCOURTHIAL 3 years ago
parent 2614948a67
commit 1587a63084

@ -1,44 +1,41 @@
<html> <html>
<body>
<?php
require_once("connection.php");
require_once("gatewayNews.php");
require_once("gatewayAdmins.php");
<body> $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";
<?php try{
require_once("connection.php"); $con = new Connection($dsn,$user,$pass);
require_once("gatewayNews.php"); $gateNews = new GatewayNews($con);
require_once("gatewayAdmins.php"); $gateNews->addNews(new News($title,$description,$pubdate,$link));
$gateAdmin = new gatewayAdmin($con);
$user= 'jeducourth'; $gateAdmin->addAdmin(new admin("toto","tata"));
$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{ /*$results=$gateNews->getNews();
$con = new Connection($dsn,$user,$pass); Foreach ($results as $new){
$gateNews = new GatewayNews($con); print $new->getTitle()."<br>".$new->getDescription()."<br>".$new->getPubDate()."<br>".$new->getLink()."<br><br>";
$gateNews->addNews(new News($title,$description,$pubdate,$link)); }*/
$gateAdmin = new gatewayAdmin($con); require("listeNews.php");
$gateAdmin->addAdmin(new admin("toto","tata"));
}
catch( PDOException $Exception ) {
echo 'erreur';
echo $Exception->getMessage();
}
?>
/*$results=$gateNews->getNews(); </body>
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> </html>

@ -1,7 +1,7 @@
<?php <?php
class sources class sources
{ {
public string lien; private string $lien;
public function __construct(string $lien) public function __construct(string $lien)
{ {

Loading…
Cancel
Save