my goal is to create something like this :enter image description here So an area where I can put a form for authentification or create an account. I already created a form in php which is linked to my database like this
JavaScript
x
23
23
1
<form action="connection.php" method="post">
2
<div class="form-group">
3
<label >Nom</label>
4
<input name = nom>
5
</div>
6
<div class="form-group">
7
<label >Prénom</label>
8
<input name = prenom>
9
</div>
10
<div class="form-group">
11
<label >Email</label>
12
<input name = mail>
13
</div>
14
<div class="form-group">
15
<label >Numéro de telephone</label>
16
<input name = tel>
17
</div>
18
<div class="form-group">
19
<label >mot de passe</label>
20
<input type=password id="inputPassword" placeholder="Password"">
21
</div>
22
<button type="submit" class="btn btn-primary" name="add">Creer son compte</button>
23
JavaScript
1
18
18
1
function inscription($db,$nom,$prenom,$mail,$tel,$mdp){
2
try{
3
$request_client = "INSERT INTO client (nom, prenom, mail, tel, mdp) VALUES (:nom, :prename, :email, :phone,:pass);";
4
$statement_client = $db->prepare($request_client);
5
$statement_client->bindParam(':nom', $nom);
6
$statement_client->bindParam(':prename', $prenom);
7
$statement_client->bindParam(':email', $mail);
8
$statement_client->bindParam(':phone', $tel);
9
$statement_client->bindParam(':pass', $mdp);
10
$statement_client->execute();
11
}
12
catch (PDOException $exception)
13
{
14
error_log('Request error: '.$exception->getMessage());
15
return false;
16
}
17
}
18
Is there something in boostrap or css or even js which can make me creat this blue area ?
Advertisement
Answer
You can do this with CSS, something like:
JavaScript
1
41
41
1
.blue-box {
2
max-width: 450px;
3
margin: 1rem auto;
4
padding: 1rem;
5
background: #3b52a5;
6
border-radius: 8px;
7
color: #fff;
8
}
9
10
.blue-box .form-group {
11
display: flex;
12
justify-content: space-between;
13
flex-direction: column;
14
margin: 0.5rem 0;
15
}
16
17
.blue-box .form-group input {
18
padding: 0.75rem 1rem;
19
margin-top: 0.25rem;
20
border: 1px solid #060537;
21
border-radius: 8px;
22
background: none;
23
outline: none;
24
color: #fff;
25
}
26
27
.blue-box button {
28
padding: 0.75rem 1rem;
29
margin: 0.5rem auto;
30
background: #060537;
31
border-radius: 8px;
32
width: 100%;
33
outline: none;
34
border: none;
35
color: #fff;
36
}
37
38
body {
39
background: #7db9ff;
40
font-family: sans-serif;
41
}
JavaScript
1
23
23
1
<form action="connection.php" method="post" class="blue-box">
2
<div class="form-group">
3
<label >Nom</label>
4
<input name = nom>
5
</div>
6
<div class="form-group">
7
<label >Prénom</label>
8
<input name = prenom>
9
</div>
10
<div class="form-group">
11
<label >Email</label>
12
<input name = mail>
13
</div>
14
<div class="form-group">
15
<label >Numéro de telephone</label>
16
<input name = tel>
17
</div>
18
<div class="form-group">
19
<label >mot de passe</label>
20
<input type=password id="inputPassword" placeholder="Password"">
21
</div>
22
<button type="submit" class="btn btn-primary" name="add">Creer son compte</button>
23
</form>