SAEWEB2.2/ci/application/controllers/Enregistrer.php

34 lines
937 B
PHP
Raw Permalink Normal View History

2024-06-10 11:16:43 +02:00
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Enregistrer extends CI_Controller{
public function __construct(){
parent ::__construct();
$this->load->model('model_music');
}
public function index(){
2024-06-12 11:18:32 +02:00
$this->load->view('layout/header');
2024-06-10 11:16:43 +02:00
$this->load->view('SignUp');
2024-06-12 11:18:32 +02:00
$this->load->view('layout/footer');
2024-06-10 11:16:43 +02:00
}
public function SignUp() {
$pseudo = '';
$login = '';
$password = '';
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if(isset($_POST['login']) && isset($_POST['password']) && isset($_POST['pseudo'])){
$pseudo = $_POST['pseudo'];
$login = $_POST['login'];
$password = $_POST['password'];
}
}
$this->model_music->SignUp($pseudo,$login,$password);
$this->session->set_userdata('logged', true);
2024-06-12 19:08:54 +02:00
$this->session->set_userdata('mail', $login);
2024-06-10 11:16:43 +02:00
$this->load->view('layout/header');
redirect('albums');
}
}
?>