BG Development


  Reply to this topicStart new topicStart Poll

> Bootstrap alert box problem
xhister
: 03-01-2017, 23:24
Quote Post



:
:
:

: 91
: 09.09.16



, - . , , HTML , - alert box, . , alert box.
:

CODE

<?php
include "dbconfig.php";
$passError = "";
$newpassError = "";
$confirmpassError = "";
$error = false;
$emailError = "";
$password = "";
$newpassword = "";
$confirmnewpassword = "";
$emailsuccess = "";
$emaildanger = "";
$passsuccess = "";
$passdanger = "";
$errType = "";
$imagesuccess = "";
$imagedanger = "";
$imageError = "";
if(isset($_POST['update'])){
$email = trim($_POST['email']);
$email = strip_tags($email);
$email = htmlspecialchars($email);

if( !filter_var($email, FILTER_VALIDATE_EMAIL)){
$error = true;
$emailError = "Provided email is not valid.";
//header("Location: settings.php#changeemail");
}

if(empty($email)){
$error = true;
$emailError = "You need to enter an email.";
//header("Location: settings.php#changeemail");
}

if( !$error ){
$query = mysqli_query($connect, "update users set userEmail='$email' where userId = '".$_SESSION['user']."'");
if(isset($query)){
$errType = "success";
$emailsuccess = "Email has successfully been changed!";
$email = "";
}
else {
$errType = "danger";
$emaildanger = "Something with updating went wrong.";
}
//header("Location: settings.php");
}

if($errType = "success") { ?>
<div class="alert alert-success alert-dismissable" style="margin-top:30px;">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<span class="glyphicon glyphicon-info-sign"></span> <?php echo $emailsuccess; ?>
</div>
<?php } elseif($errType = "danger"){ ?>
<div class="alert alert-danger alert-dismissable" style="margin-top:30px;">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<span class="glyphicon glyphicon-info-sign"></span> <?php echo $emaildanger; ?>
</div>
<?php }
} ?>


:

<form class="form-horizontal" method="post" action="settings.php" id="changemail" role="form" style="margin-bottom:50px;"> <!-- action="settings.php#changeemail" id="changeemail" -->


<div class="row" style="width:100%;">
<h4 class="col-md-12 col-xs-12 col-sm-12" style="color:black; margin-bottom:30px;">Change email:</h4>
<div class="col-md-12 col-xs-12 col-sm-12">
<div class="form-group">
<p class="col-md-3" style="color:black; text-align:center;"><b>Username:</b></p>
<p class="col-md-9" style="text-align:left; color:black;"><b><?php echo $row['userName']; ?></b></p>
</div>
</div>

<div class="col-md-12 col-xs-12 col-sm-12">
<div class="form-group" style="margin-top:15px;">
<p class="col-md-3" style="color:black; text-align:center;"><b>Current email:</b></p>
<p class="col-md-9" style="text-align:left; color:black;"><b><?php echo $row['userEmail']; ?></b></p>
</div>
</div>

<div class="col-md-12 col-xs-12 col-sm-12">
<div class="form-group" style="margin-top:15px;">
<p class="col-md-3 control-label" style="color:black; text-align:center;"><b>Change email:</b></p>
<div class="col-md-9">
<input type="text" class="form-control" id="email" name="email" placeholder="Email" style="color:black;"/>
<span class="text-danger" ><?php echo $emailError; ?></span>
</div>
</div>
</div>

<div class="col-md-12 col-xs-12 col-sm-12" style="margin-top:30px; text-align:right;">
<button type="submit" name="update" class="btn btn-primary" >Update</button>
</div>
</div>
</form>


, :. !

xhister 03-01-2017, 23:27
PMEmail Poster
Top
Bender
: 03-01-2017, 23:31
Quote Post



:
:
:

: 3424
: 19.06.14



, , !!!


--------------------
, -
...
, ? -
...
, , - saruman
...
. - ici
PM
Top
xhister
: 03-01-2017, 23:37
Quote Post



:
:
:

: 91
: 09.09.16



, . , , .
PMEmail Poster
Top
xhister
: 03-01-2017, 23:47
Quote Post



:
:
:

: 91
: 09.09.16



... :.
PMEmail Poster
Top
RoYaL
: 04-01-2017, 00:11
Quote Post



:
:
:

: 729
: 21.08.05



, .
PMEmail Poster
Top
1 (1 , 0 )
, :

Topic Options Reply to this topicStart new topicStart Poll

 


Copyright © 2003-2015 | BG Development | All Rights Reserved
RSS 2.0