コード例 #1
0
    $fichier = fopen('ctr/ctr.' . $generation . '.php', 'a');
    fclose($fichier);
    $fichier = fopen('lib/css/' . $generation . '.css', 'a');
    fclose($fichier);
    $fichier = fopen('lib/php/config/config.' . $generation . '.php', 'w');
    // DONNEES TEMPLATES HTML
    $insert = '<?php
	$title = \'' . $titreGeneration . '\';
	$description = \'description ' . $generation . '\';
	$design = \'' . $generation . '\';
	$script = \'1\';
	$jquery = 0;';
    fwrite($fichier, $insert);
    fclose($fichier);
    // AJOUTE UNE LIGNE DANS LE HTACCESS POUR LE REWRITE D'URL //
    $fichier = fopen('.htaccess', 'a');
    $insert = '
RewriteRule ^' . $titreGeneration . '$									index.php?action=' . $generation . ' [L]';
    fwrite($fichier, $insert);
    fclose($fichier);
}
Head::insert('1', '1', '1');
?>
	
	<form method="post">
		<input type="text" name="generation">
		<input type="submit" value="Generer les pages">
	</form>
	
<?php 
Foot::insert('1', '1');
コード例 #2
0
ファイル: index.php プロジェクト: RandomWebFactory/LasDesAss
include 'lib/php/autoload/autoload.php';
session_start();
if (!isset($_SESSION['panier'])) {
    $_SESSION['panier'] = new Cart();
}
//session_destroy();
//var_dump($_SESSION['panier']);
if (isset($_GET['action'])) {
    $action = htmlspecialchars($_GET['action']);
} else {
    header('Location:Home');
    die;
}
if (file_exists('lib/php/config/config.' . $action . '.php')) {
    include 'lib/php/config/config.' . $action . '.php';
}
$bdd = Bdd::connect();
if (file_exists('ctr/ctr.' . $action . '.php')) {
    include 'ctr/ctr.' . $action . '.php';
}
if (file_exists('mod/mod.' . $action . '.php')) {
    include 'mod/mod.' . $action . '.php';
}
Head::insert($design, $description, $title);
if (file_exists('vue/vue.' . $action . '.php')) {
    include 'vue/vue.' . $action . '.php';
} else {
    echo 'vue introuvable';
}
Foot::insert($script, $jquery);