correction du code et suppression des parties en trop
This commit is contained in:
parent
2640d39a4f
commit
f0a4f36a35
codeigniter
application
config
controllers
views
assets
@ -51,8 +51,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
|||||||
*/
|
*/
|
||||||
$route['default_controller'] = 'albums';
|
$route['default_controller'] = 'albums';
|
||||||
$route['connexion'] = 'ConnexionController/connexion';
|
$route['connexion'] = 'ConnexionController/connexion';
|
||||||
$route['inscription'] = 'InscriptionController/inscription';
|
$route['traitement'] = 'ConnexionController/traitement';
|
||||||
$route['traitement'] = 'InscriptionController/traitement';
|
|
||||||
$route['authentifier'] = 'ConnexionController/authentifier';
|
$route['authentifier'] = 'ConnexionController/authentifier';
|
||||||
$route['deconnexion'] = 'ConnexionController/deconnexion';
|
$route['deconnexion'] = 'ConnexionController/deconnexion';
|
||||||
$route['404_override'] = '';
|
$route['404_override'] = '';
|
||||||
|
@ -38,6 +38,39 @@ class ConnexionController extends CI_Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function traitement() {
|
||||||
|
if(isset($_POST['ok'])){
|
||||||
|
$this->load->database();
|
||||||
|
|
||||||
|
|
||||||
|
$prenom = ucfirst(strtolower($this->input->post('prenom')));
|
||||||
|
$nom = strtoupper($this->input->post('nom'));
|
||||||
|
$pseudo = $this->input->post('pseudo');
|
||||||
|
$mdp = $this->input->post('pass');
|
||||||
|
$email = $this->input->post('email');
|
||||||
|
|
||||||
|
$data = array(
|
||||||
|
'pseudo' => $pseudo,
|
||||||
|
'nom' => $nom,
|
||||||
|
'prenom' => $prenom,
|
||||||
|
'mdp' => $mdp,
|
||||||
|
'email' => $email
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->db->insert('users', $data);
|
||||||
|
|
||||||
|
$this->session->set_userdata('pseudo', $pseudo);
|
||||||
|
redirect('../index.php');
|
||||||
|
|
||||||
|
|
||||||
|
$this->load->view('layout/header');
|
||||||
|
$this->load->view('connexion', $data);
|
||||||
|
$this->load->view('layout/footer');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function deconnexion() {
|
public function deconnexion() {
|
||||||
$this->session->unset_userdata('pseudo');
|
$this->session->unset_userdata('pseudo');
|
||||||
$this->session->sess_destroy();
|
$this->session->sess_destroy();
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
<h1>Se connecter</h1>
|
|
||||||
<form action="authentifier" method="POST">
|
|
||||||
<label for="email">Email:</label>
|
|
||||||
<input type="email" id="email" name="email" required>
|
|
||||||
<label for="password">Mot de passe:</label>
|
|
||||||
<input type="password" id="password" name="password" required>
|
|
||||||
<button type="submit">Connexion</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<?php if(isset($error_msg)): ?>
|
|
||||||
<div class="error-message"><?= $error_msg ?></div>
|
|
||||||
<?php endif; ?>
|
|
@ -1,24 +0,0 @@
|
|||||||
<h1>S'inscrire</h1>
|
|
||||||
<form action="traitement" method="POST">
|
|
||||||
<label for="nom">Votre nom*</label>
|
|
||||||
<input type="text" id="nom" name="nom" placeholder="Entrez votre nom" required>
|
|
||||||
|
|
||||||
<label for="prenom">Votre prénom*</label>
|
|
||||||
<input type="text" id="prenom" name="prenom" placeholder="Entrez votre prénom" required>
|
|
||||||
|
|
||||||
<label for="pseudo">Votre pseudo*</label>
|
|
||||||
<input type="text" id="pseudo" name="pseudo" placeholder="Entrez votre pseudo" required>
|
|
||||||
|
|
||||||
<label for="email">Votre email*</label>
|
|
||||||
<input type="email" id="email" name="email" placeholder="Entrez votre adresse email" required>
|
|
||||||
|
|
||||||
<label for="pass">Votre mot de passe*</label>
|
|
||||||
<input type="password" id="pass" name="pass" placeholder="Entrez votre mdp" required>
|
|
||||||
|
|
||||||
<input type="submit" value="M'inscrire" name="ok">
|
|
||||||
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<?php if(isset($confirmation_message)): ?>
|
|
||||||
<div class="confirmation-message"><?= $confirmation_message ?></div>
|
|
||||||
<?php endif; ?>
|
|
@ -17,22 +17,25 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li><strong>Music APP</strong></li>
|
<li><strong>Music APP</strong></li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="option">
|
<div class="options">
|
||||||
<li><?=anchor('albums','Albums');?></li>
|
<ul>
|
||||||
<li><?=anchor('artistes','Artistes');?></li>
|
<li class="bouton"><?=anchor('albums','Albums');?></li>
|
||||||
<li><?=anchor('playlist','Playlist');?></li>
|
<li class="bouton"><?=anchor('artistes','Artistes');?></li>
|
||||||
|
<li class="bouton"><?=anchor('playlist','Playlist');?></li>
|
||||||
<?php if ($this->session->userdata('pseudo')) : /* Vérifier si l'utilisateur est connecté */ ?>
|
<?php if ($this->session->userdata('pseudo')) : /* Vérifier si l'utilisateur est connecté */ ?>
|
||||||
|
|
||||||
<li class="deroulant"><a><?= $this->session->userdata('pseudo'); ?></a>
|
<li class="deroulant"><a><?= $this->session->userdata('pseudo'); ?></a>
|
||||||
<ul class="sous">
|
<ul class="sous">
|
||||||
|
|
||||||
<li class="menu"><a href="#"><?= anchor('deconnexion', 'Se déconnecter'); ?></a></li>
|
<li><a><?= anchor('profil', 'Profil'); ?></a></li>
|
||||||
|
<li><a><?= anchor('deconnexion', 'Se déconnecter'); ?></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<li><?= anchor('connexion', 'Se connecter'); ?></li>
|
<li><?= anchor('connexion', 'Se connecter'); ?></li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -35,8 +35,17 @@ main.container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.option {
|
.options {
|
||||||
margin-right : 20px!important;
|
margin-right : 20px!important;
|
||||||
|
width: 400px;
|
||||||
|
height: 73.5px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.bouton {
|
||||||
|
width: 25%;
|
||||||
|
text-align: center;
|
||||||
|
height: 73.5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sous {
|
.sous {
|
||||||
@ -45,6 +54,15 @@ main.container {
|
|||||||
border: solid 1px black;
|
border: solid 1px black;
|
||||||
background-color: #283d5d;
|
background-color: #283d5d;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
top :60px;
|
||||||
|
right: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.sous li{
|
||||||
|
float: none;
|
||||||
|
text-align: right;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
nav > ul li:hover .sous{
|
nav > ul li:hover .sous{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user