I'm having problem to get my different div from my php function
This is the code
error_reporting(E_ALL | E_NOTICE);
ini_set('display_errors', '1');
require_once("./include/membersite_config.php");
if (!$fgmembersite->CheckLogin()) {
$fgmembersite->RedirectToURL("index.php");
exit;
}
if (isset($_POST['submitted'])) {
if($fgmembersite->ChangePassword()){
echo '<div id="ajaxDivOk">';
sleep(3);
$fgmembersite->RedirectToURL("index.php");
}
else{
echo '<div id="ajaxDivErro">';
sleep(3);
}
}
?>
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>EBSPMA PAAD</title>
<link href="css/styles.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/modernizr.js?cb=2.2.3.2085"></script>
<script type="text/javascript">
</script>
</head>
<body>
<header role="banner" class="main-header">
<!-- MAIN HEADER -->
<div class="main-header-body">
<div class="container-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-xs-3">
<h2>
PAAD-GesDocente</h2>
</div>
<div class="col-xs-4 col-xs-offset-1 main-header-title">
<p class="sizeToggle" >Mudar Password</p>
</div>
</div>
</div>
</div>
</div>
</header><section class="content">
<div class="grid">
<div class="box">
<form name="changepwd" id="loginForm" action='<?php echo $fgmembersite->GetSelfScript(); ?>' method="POST">
<input type="hidden" name='submitted' id='submitted'/>
<input type="hidden" name="path" value="painelAdquirente.action"/>
<div>
<p><b><font color="red">A sua password deve ser alterada!</font></b></p></div>
<div class="icon-input">
<label for="password"></label>
<div class="input password">
<i class="fa fa-lock"></i>
<input type="password" name="oldpwd" id="oldpwd" placeholder="Senha antiga">
</div>
</div>
<br>
<div class="icon-input">
<label for="password"></label>
<div class="input password">
<i class="fa fa-lock"></i>
<input type="password" name="newpwd" id="newpwd" placeholder="Senha nova">
</div>
<input type="hidden" name="email" id="email" value="<?php echo $fgmembersite->UserEmail(); ?>">
</div>
<br>
<input type="submit" id="sbmtLogin" class="sa-btn1" value="Mudar">
</form>
</div>
<div class="form-group">
<div id="ajaxDivOk" name="ajaxDivOk" style="display:none" class="alert alert-success">Modificado com sucesso...Faça login novamente</div>
</div>
<div class="form-group">
<div id="ajaxDivErro" name="ajaxDivErro" style="display:none" class="alert alert-danger">Opss....Erro, tente mais tarde</div>
</div>
</div>
</section>
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/jquery.validate.min.js"></script>
<script src="js/plugins.js?cb=2.2.3.2085"></script>
</body>
</html>
The div is not show but in fiddler i get
<div id="ajaxDivOk">
So the php function is working properly since the password is changed and i should have the div
Any help please?
Thanks
You can set which notification you want to show up when you do your checks at the beginning, and then display the appropriate one in the following HTML. You can handle the redirect the same way.
if (isset($_POST['submitted'])) {
if ($fgmembersite->ChangePassword()) {
$redirect = '<meta http-equiv="refresh" content="3; url=index.php" />';
$notice = '<div id="ajaxDivOk" name="ajaxDivOk" class="alert alert-success">
Modificado com sucesso...Faça login novamente</div>';
} else {
$redirect = '';
$notice = '<div id="ajaxDivErro" name="ajaxDivErro" class="alert alert-danger">
Opss....Erro, tente mais tarde</div>';
}
}
Then in the <head> of your document...
<head>
<?php if isset($redirect) echo $redirect; ?>
...
And later where you are displaying the notifications:
<div class="form-group">
<?php if isset($notice) echo $notice; ?>
</div>
Related
I am new to PHP so please help me out
the errors that I keep getting are
Notice: Undefined index: image1 in C:\wamp\www\Tech Cube\add-product.php on line 12
Warning: file_get_contents(): Filename cannot be empty in C:\wamp\www\Tech Cube\add-product.php on line 12
Notice: Undefined index: image2 in C:\wamp\www\Tech Cube\add-product.php on line 13
Warning: file_get_contents(): Filename cannot be empty in C:\wamp\www\Tech Cube\add-product.php on line 13
and my code is
<?php
$connection = mysqli_connect("localhost","root","");
$db = mysqli_select_db($connection,'techcubedb');
if(isset($_POST['add']))
{
if(!empty($_POST['name']) && !empty($_POST['price']) &&!empty($_POST['image1']) &&!empty($_POST['image2'])){
$name = $_POST['name'];
$price = $_POST['price'];
$description = $_POST['description'];
$image1 = addslashes(file_get_contents($_FILES["image1"]["tmp_name"]));
$image2 = addslashes(file_get_contents($_FILES["image2"]["tmp_name"]));
$query = "INSERT INTO 'products'('name','price','description','image1','image2')VALUES ('$name','$price','$description','$image1','$image2')";
$query_run=mysqli_query($connection,$query);
if($query_run)
{
echo '<script type="text/javascript"> alert("Product Added")</script>';
}
else{
echo '<script type="text/javascript"> alert("Product not Added")</script>';
}
}
else{
echo '<script type="text/javascript"> alert("All fields are required")</script>';
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>add product</title>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<Center>
<div class="container">
<div class="col-md-6 mx-auto text-center">
<div class="header-title">
<br><br>
<h1 class="wv-heading--title">
Add Product
</h1>
</div>
<br>
</div>
<div class="row">
<div class="col-md-4 mx-auto">
<div class="myform form ">
<form action=" " method="post" encrtype="multipart/form-data">
<div class="form-group ">
<label>Product name</label>
<input type="text" name="name" class="form-control" >
<span class="help-block"></span>
</div>
<div class="form-group ">
<label>Price</label>
<input type="text" name="price" class="form-control" >
<span class="help-block"></span>
</div>
<div class="form-group ">
<label>Description</label>
<textarea type="text" name="description" class="form-control" ></textarea>
<span class="help-block"></span>
</div>
<div class="form-group ">
<label>Images</label><br>
<input type="file" name="image1" id="image1">
<span class="help-block"></span>
</div>
<div class="form-group ">
<input type="file" name="image2" id="image2">
<span class="help-block"></span>
</div>
<br>
<br>
<div class="form-group">
<input type="submit" name="add" class="btn btn-primary" value="Add Product">
</div>
</form>
</div>
</div>
</div>
</div>
</Center>
</body>
</html>
May be you will need two edits...
enctype="multipart/form-data"
instead of
encrtype="multipart/form-data"
And
!empty($_FILES['image1']['name'] ) && !empty($_FILES['image2']['name'])
And one more thing is...
you will need to check and verify uploaded file's type, size etc for security reason....
I just want to ask, why when i clicked the login with google button, it is not working and not shown anything at all?
Below is my code:
index.php file:
<?php require "../../Controller/SigninController.php"; use Ampp\Auth; use Ampp\Validate; ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sign In</title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Montserrat&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../../assets/css/main.css">
</head>
<body>
<div class="wrapper">
<div class="container">
<form action="" method="post" class="frm">
<h2>Sign In</h2>
<div class="form-group">
<?php if (!empty(Auth::$error[2])) echo "<span class='err'>" . Auth::$error[2] . "</span>"; ?>
</div>
<div class="form-group">
<label for="uname">Username</label>
<input type="text" name="uname" value="<?php if(!empty($_POST["uname"])) echo trim($_POST["uname"]); else { if(isset($_COOKIE["memberid"])) echo $_COOKIE["memberid"]; } ?>" id="uname" class="form-control">
<?php if (!empty(Auth::$error[0])) echo "<span class='err'>" . Auth::$error[0] . "</span>"; ?>
</div>
<div class="form-group">
<label for="upass">Password</label>
<input type="password" name="upass" value="<?php if(isset($_COOKIE["memberpassword"])) echo $_COOKIE["memberpassword"]; ?>" id="upass" class="form-control">
<?php if (!empty(Auth::$error[1])) echo "<span class='err'>" . Auth::$error[1] . "</span>"; ?>
</div>
<div class="form-group">
<input type="submit" value="signin" name="signin" class="btn">
</div>
<div class="form-group">
<div class="chkinbox flt-left">
<input type="checkbox" name="remember" class="chkbox" <?php if(isset($_COOKIE["memberid"])) echo "checked"; ?>>
<span class="checkmark"></span>
</div>
<div class="chklblbox flt-left">Remember me</div>
New user?
</div>
<div class="clear"></div>
<div class="form-group">
<input type="submit" value="Google" name="btngoogle">
</div>
</form>
</div>
</div>
</body>
</html>
startup.php file:
session_start();
require_once "vendor/autoload.php";
SigninController.php file:
if (isset($_POST["btngoogle"]))
{
$client = new Google\Client();
$client->setClientId("my_client_id.apps.googleusercontent.com");
$client->setClientSecret("my_client_secret");
$client->setRedirectUri("../../signin");
$client->addScope("email");
$client->addScope("profile");
}
if (isset($_GET["code"]))
{
$client = new Google\Client();
$token = $client->fetchAccessTokenWithAuthCode($_GET["code"]);
if (isset($token["error"]))
{
$client->setAccessToken($token["access_token"]);
$_SESSION["access_token"] = $token["access_token"];
$google_service = new Google_Service_Oauth2($client);
$data = $google_service->userinfo->get();
if (!empty($data["given_name"]) || !empty($data["family_name"]) || !empty($data["email"]) || !empty($data["gender"]) || !empty($data["picture"]))
{
if (Auth::RegisterProfile($data["given_name"], $data["family_name"], $data["email"], $data["gender"], $data["picture"]) &&
Auth::RegisterSessions($data["email"], "google"))
{
Redirect::TO("../home");
}
}
}
}
When run all above code, the browser just loading a little only and nothing more.
Your suggestion and advice really am appreciated.
I used Tecite for my contact form and am trying to get my form to work but it is coming up with an error message every time that is saying:
"An errr occurred while processing the form."
The staff... and it goes on as a generic error message.
Im not sure what I am missing in my code but would love some help!!
I have posted my code below, one being the contact.html and the other the formmail php code.
php form
---contact.html---
Haus of Originals
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="Haus of Originals Website">
<link href="css/style_contact.css" rel="stylesheet" type="text/css" />
<link rel="icon" type="image/png" href="images/h_favicon2.png">
<!-- Script -->
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<!-- Responsive and mobile friendly stuff -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Haus of Originals
</div>
<div class="button_container" id="toggle">
<span class="top"></span>
<span class="middle"></span>
<span class="bottom"></span>
</div>
<div class="overlay" id="overlay">
<nav class="overlay-menu">
<ul>
<li><a class="one" href="home.html" title="Home">Home</a></li>
<li><a class="one" href="about.html" title="About">About</a></li>
<li><a class="one active" href="contact.html" title="Contact">Contact</a></li>
</ul>
</nav>
</div>
<!-- Header Gif -->
<div class="section banner">
<h4>
We are building brands that we want to be apart of, welcome home. </h4>
</div>
<!-- Header Gif End -->
<div class="section group">
<img src="images/rtt.jpg" alt="walllogo">
</div>
<div class="section group three">
<div class="column span_1_of_2">
<h5>Contact</h5>
<h6> Haus of Originals<br>
28 Intrepid Drive <br>
Bozeman, Montana 59718
<br>
<br>
651.470.6511<br>
406.459.5954
<br> <br>
<a class="three" href="mailto:info#hausoforiginals.com">info#hausoforiginals.com</a>
</h6>
</div>
<div class="column span_2_of_2">
</div>
</div>
<div class="section group four">
<section class="contact-wrap">
<!--Form Action Needs to point to where you have uploaded the formail.php file-->
<form method="post" action="http://www.hausoforiginals.com/formmail/formmail.php" name="ContactForm" class="contact-form">
<!-- Keep this line it's base settings to check and send the form -->
<input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER" />
<!-- This sets where the email is sent to -->
<input type="hidden" name="recipients" value="info#hausoforiginals.com" />
<!-- This sets the fields to be required. -->
<input type="hidden" name="required" value="EmailAddress:Your email address,FirstName:Your name,Message: Your message" />
<div class="col-sm-6">
<div class="input-block">
<label for="FirstName">First Name</label>
<input type="text" name="FirstName" class="form-control">
</div>
</div>
<div class="col-sm-12">
<div class="input-block">
<label for="EmailAddress">Email</label>
<input type="email" name="EmailAddress" class="form-control">
</div>
</div>
<div class="col-sm-12">
<div class="input-block">
<label for="MessageSubject">Subject</label>
<input type="text" name="MessageSubject" class="form-control">
</div>
</div>
<div class="col-sm-12">
<div class="input-block textarea">
<label for="Message">Spit it Out</label>
<textarea rows="3" name="Message" class="form-control"></textarea>
</div>
</div>
<div class="col-sm-12">
<input type="submit" value="Submit" class="square-button">Send It
</div>
</form>
</section>
</div>
<div class="section group two">
<div class="col spanfooter_1_of_3">
<img class="logoone" src="images/h_logo_hp.jpg" alt="logo">
</div>
<div class="col spanfooter_2_of_3">
<h2>Handles </h2>
<p>Instagram</p>
<p>Twitter </p>
<p>Facebook </p>
<b>back to top</b>
</div>
<div class="col spanfooter_3_of_3">
<h2>Get in Touch</h2>
<p> 651.470.6511 <b>|</b> 406.459.5954 </p><br>
<a class="two" href="mailto:info#hausoforiginals.com"><b>info#hausoforiginals.com</b></a>
<br>
<p>
2017 © All Rights Reserved
</p>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$(window).bind('scroll', function() {
checkScrollPos();
});
checkScrollPos();
$('.toTopLink').bind('click', function() {
$('html, body').animate({
scrollTop: 0
}, $(window).scrollTop() / 3);
return false;
});
});
function checkScrollPos() {
if ($(window).scrollTop() > 600) {
$('.toTopLink').fadeIn(1000);
} else {
$('.toTopLink').fadeOut(1000);
}
}
$(document).ready(function() {
//material contact form
$('.contact-form').find('.form-control').each(function() {
var targetItem = $(this).parent();
if ($(this).val()) {
$(targetItem).find('label').css({
'top': '10px',
'fontSize': '14px'
});
}
})
$('.contact-form').find('.form-control').focus(function() {
$(this).parent('.input-block').addClass('focus');
$(this).parent().find('label').animate({
'top': '10px',
'fontSize': '14px'
}, 300);
})
$('.contact-form').find('.form-control').blur(function() {
if ($(this).val().length == 0) {
$(this).parent('.input-block').removeClass('focus');
$(this).parent().find('label').animate({
'top': '25px',
'fontSize': '18px'
}, 300);
}
})
});
$('#toggle').click(function() {
$(this).toggleClass('active');
$('#overlay').toggleClass('open');
});
</script>
I'm having another problem with this code. I have tried different ways but no success.
if (isset($_POST['submitted'])) {
if($fgmembersite->ChangePassword()){
echo '<div id="ajaxDivOk">Password alterada com sucesso</div>';
sleep(2);
$fgmembersite->RedirectToURL("index.php");
}
echo '<div id="ajaxDivErro">A mudança de password não foi efetuadada....tente mais tarde</div>';
sleep(2);
}
In the debugger, I get the echo...but not in the main page.
This is my main page:
<?PHP
error_reporting(E_ALL | E_NOTICE);
ini_set('display_errors', '1');
require_once("./include/membersite_config.php");
if (!$fgmembersite->CheckLogin()) {
$fgmembersite->RedirectToURL("index.php");
exit;
}
if (isset($_POST['submitted'])) {
if($fgmembersite->ChangePassword()){
echo '<div id="ajaxDivOk">Password alterada com sucesso</div>';
sleep(2);
$fgmembersite->RedirectToURL("index.php");
}
echo '<div id="ajaxDivErro">A mudança de password não foi efetuadada....tente mais tarde</div>';
sleep(2);
}
$email = $fgmembersite->UserEmail();
?>
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>EBSPMA Atividades</title>
<link href="css/styles.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/modernizr.js?cb=2.2.3.2085"></script>
<script type="text/javascript">
</script>
</head>
<body>
<header role="banner" class="main-header">
<!-- MAIN HEADER -->
<div class="main-header-body">
<div class="container-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-xs-3">
<h2>EBSPMA PAAD</h2>
</div>
<div class="col-xs-4 col-xs-offset-1 main-header-title">
<p class="sizeToggle" >Mudar Password</p>
</div>
</div>
</div>
</div>
</div>
</header><section class="content">
<div class="grid">
<div class="box">
<form name="changepwd" id="loginForm" action='<?php echo $fgmembersite->GetSelfScript(); ?>' method="POST">
<input type="hidden" name='submitted' id='submitted'/>
<input type="hidden" name="path" value="painelAdquirente.action"/>
<div>
<p><b><font color="red">A sua password deve ser alterada!</font></b></p></div>
<div class="icon-input">
<label for="password"></label>
<div class="input password">
<i class="fa fa-lock"></i>
<input type="password" name="oldpwd" id="oldpwd" placeholder="Senha antiga">
</div>
</div>
<br>
<div class="icon-input">
<label for="password"></label>
<div class="input password">
<i class="fa fa-lock"></i>
<input type="password" name="newpwd" id="newpwd" placeholder="Senha nova">
</div>
<input type="hidden" name="email" id="email" value="<?php echo $email; ?>">
</div>
<br>
<input type="submit" id="sbmtLogin" class="sa-btn1" value="Mudar">
</form>
</div>
<div class="form-group">
<div id="ajaxDivOk" style="display:none" class="alert alert-success">Aqui</div>
</div>
<div class="form-group">
<div id="ajaxDivErro" style="display:none" class="alert alert-danger"></div>
</div>
</div>
</section>
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/jquery.validate.min.js"></script>
<script src="js/plugins.js?cb=2.2.3.2085"></script>
</body>
</html>
The function is working since I receive in my debugger the sentence
<div class="alert alert-success">Verifique o seu mail....Obrigado</div>
So what's wrong?
UPDATE:
I'm still having a problem: now I have this error:
Uncaught ReferenceError: checkMudaPass is not defined
The function is:
<script type="text/javascript">
function checkMudaPass(){
var res = "<?php echo $result; ?>";
console.log(res);
if(res === "1"){
document.getElementById('ajaxDivOk').style.display = "block";
document.getElementById('ajaxDivOk').innerHTML = "A mudança de password foi efetuada....Verifique o seu email";
}else{
document.getElementById('ajaxDivErro').style.display = "block";
document.getElementById('ajaxDivErro').innerHTML = "A mudança de password não foi efetuada";
}
setTimeout(function(){
window.location='index.php';
}, 5000);
};
</script>
<input type="submit" id="submitted" name="submitted" class="sa-btn1" value="Mudar" onclick="checkMudaPass()">
I want to know how to display a user's username inside a textbox. I'm doing this because when they edit their settings and update them, it updates their email etc to blank fields in the database:
Here's the code i'd like to change
<input type="text" name="name" class="form-control" id="name" class="required" value="<? echo $row_settings['full_name']; ?>" />
I'd like to make the `value = $row_settings['full_name'];'
How can i do this?
ALL CODE:
<?php
/********************** MYSETTINGS.PHP**************************
This updates user settings and password
************************************************************/
include 'dbc.php';
page_protect();
$err = array();
$msg = array();
if($_POST['doUpdate'] == 'Update')
{
$rs_pwd = mysql_query("select pwd from users where id='$_SESSION[user_id]'");
list($old) = mysql_fetch_row($rs_pwd);
$old_salt = substr($old,0,9);
//check for old password in md5 format
if($old === PwdHash($_POST['pwd_old'],$old_salt))
{
$newsha1 = PwdHash($_POST['pwd_new']);
mysql_query("update users set pwd='$newsha1' where id='$_SESSION[user_id]'");
$msg[] = "Your new password is updated";
//header("Location: mysettings.php?msg=Your new password is updated");
} else
{
$err[] = "Your old password is invalid";
//header("Location: mysettings.php?msg=Your old password is invalid");
}
}
if($_POST['doSave'] == 'Save')
{
// Filter POST data for harmful code (sanitize)
foreach($_POST as $key => $value) {
$data[$key] = filter($value);
}
mysql_query("UPDATE users SET
`full_name` = '$data[name]',
`address` = '$data[address]',
`tel` = '$data[tel]',
`user_email` = '$data[user_email]',
`user_name` = '$data[user]',
`fax` = '$data[fax]',
`country` = '$data[country]',
`website` = '$data[web]'
WHERE id='$_SESSION[user_id]'
") or die(mysql_error());
//header("Location: mysettings.php?msg=Profile Sucessfully saved");
$msg[] = "Profile Sucessfully saved";
}
$rs_settings = mysql_query("select * from users where id='$_SESSION[user_id]'");
?>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="../../assets/ico/favicon.ico">
<script language="JavaScript" type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script language="JavaScript" type="text/javascript" src="js/jquery.validate.js"></script>
<script>
$(document).ready(function(){
$("#myform").validate();
$("#pform").validate();
});
</script>
<title>The Infibox - Edit Profile</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/indexSettings.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<?php if (isset($_SESSION['user_id'])) {?>
<a class="navbar-brand" href="#">Infibox</a>
<a class="navbar-brand">|</a>
<a class="navbar-brand" href="/recruitment">My Account</a>
<a class="navbar-brand" href="#">Settings</a>
<a class="navbar-brand" href="#">Logout</a>
<?php }
?>
<?php
if (checkAdmin()) {
/*******************************END**************************/
?>
<a class="navbar-brand" href="admin.php">Admin CP </a>
<?php } ?>
</div>
<div class="navbar-collapse collapse">
<form class="navbar-form navbar-right" role="form">
<div class="form-group">
<input type="text" placeholder="Email" class="form-control">
</div>
<div class="form-group">
<input type="password" placeholder="Password" class="form-control">
</div>
<button type="submit" class="btn btn-success">Sign in</button>
</form>
</div><!--/.navbar-collapse -->
</div>
</div>
<!-- Main jumbotron for a primary marketing message or call to action -->
<p>
<?php
if(!empty($err)) {
echo "<div class=\"msg\">";
foreach ($err as $e) {
echo "* Error - $e <br>";
}
echo "</div>";
}
if(!empty($msg)) {
echo "<div class=\"msg\">" . $msg[0] . "</div>";
}
?>
</p>
<!-- Show their details inside the correct box. E.g. their first name they registered with will be shown inside the "First Name" box. Does not occur with passwords. -->
<center>
<div class="wrapper">
<h2 class="title">Edit Profile</h2>
<?php while ($row_settings = mysql_fetch_array($rs_settings)) ?>
<form action="mysettings1.php" method="post" name="myform" id="myform">
<div class="input-group" id="fname">
<span class="input-group-addon">Name</span>
<input type="text" name="name" class="form-control" id="name" class="required" value="<? echo $row_settings['full_name']; ?>" />
</div>
<div class="input-group">
<span class="input-group-addon">Customer ID</span>
<input type="text" name="user" class="form-control" maxlength="6" id="web2" value="<? echo $row_settings['user_name']; ?>">
</div>
<div class="input-group">
<span class="input-group-addon">Email</span>
<input type="text" class="form-control" name="user_email" id="web3" value="<? echo $row_settings['user_email']; ?>">
</div>
<div class="input-group">
<span class="input-group-addon">Add Paypal Email</span>
<input type="text" class="form-control" name="tel" id="tel" class="required" value="<? echo $row_settings['tel']; ?>">
</div>
<div class="btn-group">
<input name="doSave" type="submit" id="doSave" value="Save" class="btn btn-success">
</div>
<hr class="hr" />
<!-- When Changing Password Old Password Must Be Entered + Correct-->
<h2 class="title2">Change Password</h2>
<div class="input-group">
<span class="input-group-addon">Old Password</span>
<input type="password" class="form-control" name="pwd_old" class="required password" id="pwd_old" >
</div>
<div class="input-group">
<span class="input-group-addon">New Password</span>
<input type="password" class="form-control" name="pwd_new" class="required password" id="pwd_new" >
</div>
<div class="btn-group">
<input name="doUpdate" type="submit" id="doUpdate" value="Update" class="btn btn-success">
</div>
</div>
</center>
</form>
<!-- ##################################################################################### -->
<!-- ##################################################################################### -->
</div>
</center>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
You do not need a while loop:
Change
<?php while ($row_settings = mysql_fetch_array($rs_settings)) ?>
with
<?php $row_settings = mysql_fetch_array($rs_settings); ?>