source modif

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

@ -1,44 +1,41 @@
<html> <html>
<body>
<body> <?php
require_once("connection.php");
require_once("gatewayNews.php");
<?php require_once("gatewayAdmins.php");
require_once("connection.php");
require_once("gatewayNews.php"); $user= 'jeducourth';
require_once("gatewayAdmins.php"); $pass='achanger';
$dsn='mysql:host=localhost;dbname=dbjeducourth';
$user= 'jeducourth';
$pass='achanger'; $title="titre";
$dsn='mysql:host=localhost;dbname=dbjeducourth'; $description="descirption du titre";
$pubdate="2022-04-12 8:8:8";
$title="titre"; $link="exemple.com";
$description="descirption du titre";
$pubdate="2022-04-12 8:8:8"; try{
$link="exemple.com"; $con = new Connection($dsn,$user,$pass);
$gateNews = new GatewayNews($con);
try{ $gateNews->addNews(new News($title,$description,$pubdate,$link));
$con = new Connection($dsn,$user,$pass); $gateAdmin = new gatewayAdmin($con);
$gateNews = new GatewayNews($con);
$gateNews->addNews(new News($title,$description,$pubdate,$link)); $gateAdmin->addAdmin(new admin("toto","tata"));
$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> /*$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> </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