Trouble with validation after registration - php

I'm doing a registration page. It requires the name, password, email, gender, nationality, date of birth and other things.
I did the registration and it was good. But I need to add the validation and this is what I could do so far:
<?php include("config.php"); ?>
<!DOCTYPE html>
<html lang="en">
<!-- CSS -->
<link rel="stylesheet" href="css/styles.css" type="text/css"/>
<link type="text/css" href="css/jquery-ui-1.7.2.custom.css" rel="stylesheet" />
<!-- JavaScript -->
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js"></script>
<script src="js/validation.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
$('#datepicker').datepicker({
dateFormat:'dd/mm/yy',
changeMonth: true,
changeYear: true,
yearRange: '-90:+0',
maxDate: '+0'
});
});
</script>
</head>
<head>
<title></title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/reset.css" type="text/css" media="all">
<link rel="stylesheet" href="css/layout.css" type="text/css" media="all">
<link rel="stylesheet" href="css/style.css" type="text/css" media="all">
<script type="text/javascript" src="js/jquery-1.4.2.js" ></script>
<script type="text/javascript" src="js/cufon-yui.js"></script>
<script type="text/javascript" src="js/cufon-replace.js"></script>
<script type="text/javascript" src="js/Myriad_Pro_italic_600.font.js"></script>
<script type="text/javascript" src="js/Myriad_Pro_italic_400.font.js"></script>
<script type="text/javascript" src="js/Myriad_Pro_400.font.js"></script>
<!--[if lt IE 9]>
<script type="text/javascript" src="http://info.template-help.com/files/ie6_warning/ie6_script_other.js"></script>
<script type="text/javascript" src="js/html5.js"></script>
<![endif]-->
<?php $error_messages = array(
'T1' => 'Please enter a Name to proceed.',
'T2' => 'Please enter a valid Email Address to continue.',
'T3' => 'Please enter your Message to continue.'
);
?>
</head>
<body id="page2">
<div class="body1">
<div class="main">
<!-- header -->
<header>
<div class="wrapper">
<h1>Air Lines<span id="slogan">International Travel</span></h1>
<div class="right">
<nav>
<ul id="top_nav">
<li><img src="images/img1.gif" alt=""></li>
<li><img src="images/img2.gif" alt=""></li>
<li class="bg_none"><img src="images/img3.gif" alt=""></li>
</ul>
</nav>
<nav>
<ul id="menu">
<li>Home</li>
<li id="menu_active" >Login/sign up</li>
<li>Vision and mission</li>
<li>Contacts</li>
</ul>
</nav>
</div>
</div>
</header>
</div>
</div>
<div class="main">
<div id="banner"></div>
</div>
<!-- header -->
<div class="main">
<!-- content -->
<section id="content">
<article class="col1">
<div class="pad_1">
<h2>Login</h2>
<form id="form_1" action="login.php" method="post">
<div class="wrapper">
User Name:
<div class="bg"><input type="text" name="LogIn_Name" class="input input1" value="Enter your name" onblur="if(this.value=='') this.value='Enter your name'" onfocus="if(this.value =='Enter your name' ) this.value=''"></div>
</div>
<div class="wrapper">
Password:
<div class="bg"><input type="password" name="LogIn_Pass" class="input input1" value="Enter your password" onblur="if(this.value=='') this.value='Enter your password'" onfocus="if(this.value =='Enter your password' ) this.value=''"></div>
</div>
<div class="wrapper">
<h2 id="coq"> Forget Password</h2>
<input type="submit" class="button2" value="GO">
</div>
</form>
<h2> </h2>
</div>
</article>
<article class="col2 pad_left1">
<h2>Registration</h2>
<div class="wrapper">
<figure class="left marg_right1"></figure>
<p>
<form id="form_1" action="" method="post">
<div class="wrapperr" >
<?php
$username = $_POST["T1"];
$password = $_POST["T2"];
$repassword = $_POST["T3"];
$email = $_POST["T4"];
$gender = $_POST["T5"];
$Cou = $_POST["T6"];
$DO= $_POST["T7"];
$passport= $_POST["T8"];
$phone= $_POST["T9"];
{
if((strlen($username)<3)){
echo "The username is too short"."</br>";
if((strlen($gender)<3)){
echo "Gender"."</br>";
}
if((strlen($Cou)<2)){
echo "The CO too short"."</br>";
}
if((strlen($phone)<5)){
echo "The phone is too short"."</br>";
}
if((strlen($password)<5)){
echo "The password is too short"."</br>";
}
}
else{
if($password == $repassword){
$chec = mysql_query("SELECT * FROM register WHERE name='$username'");
if(strlen($chec['name'])>0){
echo "The username '$username' already exists";
}
else{
$check_variable=stripos($email,"#");
if($check_variable){
$password=md5($password);
mysql_query("INSERT INTO register (name,password,email,gender,country,DOB,phone,passport) VALUES ('$username','$password','$email','$gender','$Cou','$DO','$phone','$passport')");
echo "Registration Successful .. Click <a href='index.php'> here </a> to home";
}
else{
echo "email is invalid";
}
}
}
else{
echo "The password in both field doesn't match.";
}
}
}
?>
</div> <div class="wrapper">
Name:
<div class="bg"><input type="text" name="T1" class="input input1" value="Enter your name" onblur="if(this.value=='') this.value='Enter your name'" onfocus="if(this.value =='Enter your name' ) this.value=''"></div>
</div>
<div class="wrapper">
Password:
<div class="bg"><input type="password" name="T2" class="input input1" value="Enter the password" onblur="if(this.value=='') this.value='Enter the password'" onfocus="if(this.value =='Enter the password' ) this.value=''"></div>
</div>
<div class="wrapper">
Confirm password:
<div class="bg"><input type="password" name="T3" class="input input1" value="Confirm the password" onblur="if(this.value=='') this.value='Confirm the password'" onfocus="if(this.value =='Confirm the password' ) this.value=''"></div>
</div>
<div class="wrapper">
e-mail:
<div class="bg"><input type="text" name = "T4" class="input input1" value="Enter your e-mail" onblur="if(this.value=='') this.value='Enter your e-mail'" onfocus="if(this.value =='Enter your e-mail' ) this.value=''"></div>
</div>
<div class="wrapper">
Gender:
<div class="bg">
<td>
<input type="radio" name="T5" value="Male">
Male
</td><td>
<input type="radio" name="T5" value="Female">
Female</td>
</div>
</div>
<div class="wrapper">
NATIONALITY:
<div class="bg"><input type="text" name="T6" class="input input1" value="Enter your country" onblur="if(this.value=='') this.value='Enter your country'" onfocus="if(this.value =='Enter your country' ) this.value=''"></div>
</div>
<div class="wrapper">
<div class="wrapper">
Passport number:
<div class="bg"><input type="text" name="T8" class="input input1" value="Enter your passport number" onblur="if(this.value=='') this.value='Enter your passport number'" onfocus="if(this.value =='Enter your passport number' ) this.value=''"></div>
</div>
<div class="wrapper">
Date of birth:
<div class="wrapper">
<div class="bg left"><input type="text" name="T7" class="input input2" value="mm/dd/yyyy " onblur="if(this.value=='') this.value='mm/dd/yyyy '" onfocus="if(this.value =='mm/dd/yyyy ' ) this.value=''" id="datepicker" >
<br/><span id="bdayInfo"></span>
</div>
<div class="bg right"></div>
</div>
</div>
Phone number:
<div class="wrapper">
<div class="bg left"><input type="text" name="T9" class="input input2" value="" onblur="if(this.value=='') this.value=''" onfocus="if(this.value =='' ) this.value=''"></div>
<div class="bg right"></div>
</div>
</div>
<div class="wrapper">
<p> </p>
<input type="submit" class="button2" name="Go" value="GO">
</div>
</form>
</p>
</div>
<p> </p>
<h2> </h2>
</article>
</section>
<!-- / content -->
</div>
<div class="body2">
<div class="main">
<!--footer -->
<footer>
Website template designed by www.templatemonster.com<br>
3D Models provided by www.templates.com
</footer>
<!-- / footer -->
</div>
</div>
<script type="text/javascript"> Cufon.now(); </script>
</body>
</html>

Always validate server side first i.e. in PHP (this is the point where it is required).
Then add JavaScript validation afterwards. It is not required, but added to improve user expecrience. Any javascript can be circumnavigated (avoided) so if you don't have the PHP backup then you're leaving your self open for trouble.
Note, I'm not saying don't add JS validation, merely that you add PHP first, JS second. Sometimes you find libraries / frameworks that can add both at the same time.
So back to your code: the error appears to be that you're checking for errors after you display the error. So it's going to fail.
Restructure your code as follows:
Create default values for your form
Create blank errors array.
If POSTED, then read in values (over defaults), validate them
If all is good, then process the form and redirect [header('location: '); exit();] to a results / thank-you page.
(Note that at this point you have not outputted any HTML at all, merely updated your default values and error array)
If all is not good (or you never got a post) then now show the HTML. You have default values for the inputs (will alos contain the POSTED values, if applicable) and error messages to display at the right points.
Basically, handle the data first, output last.
Once that is working, then ass jQuery validation (as suggested in comments). It's pretty good.

HTML 5 has a bunch of built in validation tools and you could use jQuery or Javascript to further enhance that. I am not a big fan of validating variables on a new page, especially when we could prevent the page load completely. Definitely look into some sort of Client Side validation instead of posting to the the PHP page.
W3Schools has a decent article on Javascript validation: http://www.w3schools.com/js/js_form_validation.asp
The jQuery link was already given in a comment above.
If Javascript is not your specialty then try something like this. It is prebuilt and has some nice features. Best of all it is free.
http://www.javascript-coder.com/html-form/javascript-form-validation.phtml

Related

error when connecting database to the form , and give me the below error

I am try to fill the form and I got this error. Please someone tell me why?
I have attached all the code and the images: what I want is when I fill this form, it gets automatically saved in database. And please, if you can provide me how to upload images from the same form to the same database at phpmyadmin.
Error Message:
This is the model :
class Clinic_Model extends CI_Model
{
function insert_into_db()
{
$pfn = $_POST['pfn'];
$pe = $_POST['pe'];
$pmn = $_POST['pmn'];
$pa = $_POST['pa'];
$pw = $_POST['pw'];
$ph = $_POST['ph'];
$pgt = $_POST['pgt'];
$pbp = $_POST['pbp'];
$pec = $_POST['pec'];
$this->db->query("INSERT INTO add_clinic
VALUES($pfn','$pe','$pmn','$pa','$pw','$ph','$pgt','$pbp','$pec')");
}
}
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
This is the controller
class Easyclinic extends CI_Controller {
//----------Constructor----------
public function __construct()
{
parent::__construct();
$this->load->helper('url');
//load Model
$this->load->model('clinic_model');
}
//----------BaseFunctions----------
public function index()
{
$this->load->view('add_patient');
}
public function mydata()
{
$this->load->view('mydata');
}
public function addpatient()
{
$this->load->view('add_patient');
}
//---------Advinced Functions---------
public function insert_into_db()
{
$this->load->model('clinic_model');
$this->clinic_model->insert_into_db();
$this->load->view('success');//loading success view
}
}
this is the view
<!DOCTYPE html>
<html lang="en">
<head>
<title>Add Patient</title>
<!-- for-mobile-apps -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="easyclinic" />
<script type="application/x-javascript"> addEventListener("load",
function() { setTimeout(hideURLbar, 0); }, false);
function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- //for-mobile-apps -->
<!-- //custom-theme -->
<link href="assests/css/style.css" rel="stylesheet" type="text/css"
media="all" />
<!-- js -->
<script type="text/javascript" src="assests/js/jquery-2.1.4.min.js">
</script>
<!-- //js -->
<link href='//fonts.googleapis.com/css?
family=Roboto:400,100,300,500,700,900' rel='stylesheet' type='text/css'>
</head>
<body>
<!-- banner -->
<div class="center-container">
<div class="main">
<h1 class="w3layouts_head">Add Patient Info</h1>
<h1 class="w3layouts_head">Welcome Dr.Atef</h1>
<div class="w3layouts_main_grid">
<form action="<?php echo base_url();?
>easyclinic/insert_into_db" method="post" class="w3_form_post">
<!-- day/time -->
<div class="agileits_w3layouts_main_grid w3ls_main_grid">
<span class="agileinfo_grid">
<label>Examination Date</label>
<div class="agileits_w3layouts_main_gridl">
<input class="date hasDatepicker" id="datepicker" name="Text"
type="text" value="dd/mm/yyyy" onfocus="this.value = '';" onblur="if
(this.value == '') {this.value = '';}" required="">
</div>
<div class="agileits_w3layouts_main_gridr">
<input type="time" name="Time" placeholder=" " required="">
</div>
<div class="clear"> </div>
</span>
</div>
<!-- name -->
<div class="w3_agileits_main_grid w3l_main_grid">
<span class="agileits_grid">
<label>Patient Full Name </label>
<input type="text" name="pfn" placeholder=" 4 part name"
required="">
</span>
</div>
<!-- email -->
<div class="w3_agileits_main_grid w3l_main_grid">
<span class="agileits_grid">
<label>Patient Email </label>
<input type="text" name="pe" placeholder=" Email" required="">
</span>
</div>
<!-- Phone number -->
<div class="w3_agileits_main_grid w3l_main_grid">
<span class="agileits_grid">
<label>Patient Number </label>
<input type="text" name="pmn" placeholder="Phone Number"
required="">
</span>
</div>
<!-- choose your Gender-->
<div class="content-w3ls">
<div class="form-w3ls">
<div class="content-wthree2">
<div class="grid-w3layouts1">
<div class="w3-agile1">
<label>Gender</label>
<ul>
<li>
<input type="radio" id="a-option" name="pg">
<label for="a-option">Male </label>
<div class="check"></div>
</li>
<li>
<input type="radio" id="b-option" name="pg2">
<label for="b-option">female</label>
<div class="check"><div class="inside"></div></div>
</li>
</ul>
</div>
</div>
<!-- age -->
<div class="w3_agileits_main_grid w3l_main_grid">
<span class="agileits_grid">
<label>Patient Age </label>
<input type="text" name="pa" placeholder="Patient Age"
required="">
</span>
</div>
<div class="clear"></div>
</div>
</div>
<!-- weight -->
<div class="w3_agileits_main_grid w3l_main_grid">
<span class="agileits_grid">
<label>Weight</label>
<input type="text" name="pw" placeholder="Weight in
KiloGrams" required="">
</span>
</div>
<!-- Height -->
<div class="w3_agileits_main_grid w3l_main_grid">
<span class="agileits_grid">
<label>Height</label>
<input type="text" name="ph" placeholder="Height in
CentiMeters" required="">
</span>
</div>
<!-- Glucose -->
<div class="w3_agileits_main_grid w3l_main_grid">
<span class="agileits_grid">
<label>Glucose Test</label>
<input type="text" name="pgt" placeholder="~100~140"
required="">
</span>
</div>
<!-- Heart pressure -->
<div class="w3_agileits_main_grid w3l_main_grid">
<span class="agileits_grid">
<label>Blood Pressure</label>
<input type="text" name="pbp" placeholder="~120~180"
required="">
</span>
</div>
<!-- Uoload File -->
<div>
<span class="agileits_grid">
<label>Upload sonar image</label>
<form method="post" enctype="multipart/form-data" action="upload">
</br>
Choose a file:
<input type="image" name="usi" />
<input type="submit" />
</form>
</div>
<!-- Uoload File -->
<div>
<span class="agileits_grid">
<label>Upload cbc image</label>
<form method="post" enctype="multipart/form-data" action="upload">
Choose a file:
<input type="image" name="uci" />
<input type="submit" />
</form>
</div>
<!-- day/time -->
<div class="agileits_w3layouts_main_grid w3ls_main_grid">
<span class="agileinfo_grid">
<label>Expectation of Childbirth</label>
<div class="agileits_w3layouts_main_gridl">
<input class="date hasDatepicker" id="datepicker" name="Text"
type="text" value="mm/dd/yyyy" onfocus="this.value = '';"
onblur="if (this.value == '') {this.value = '';}" required="">
</div>
<div class="agileits_w3layouts_main_gridr">
<input type="time" name="pec" placeholder=" " required="">
</div>
<div class="clear"> </div>
</span>
</div>
<!-- submit button -->
<div class="w3_main_grid">
<div class="w3_main_grid_right">
<input type="submit" name="save" value="Submit">
</div>
</div>
</form>
</div>
<!-- Calendar -->
<link rel="stylesheet" href="assests/css/jquery-ui.css" />
<script src="js/jquery-ui.js"></script>
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
<!-- //Calendar -->
<div class="w3layouts_copy_right">
<div class="container">
<p>© 2018 Patient Registration Form. All rights reserved |
HassanAli</p>
</div>
</div>
</div>
</div>
<!-- //footer -->
</body>
</html>
and this is the image of phpmyadmion:
see phpmyadmin iamge
There is a minor error of a missing ' in your columns of the INSERT statement (VALUES($pfn'), but also there is also a problem of matching the columns up. I would normally list the columns that I am inserting into as well, something like...
$this->db->query("INSERT INTO add_clinic (`Patient Full Name`, *** )
VALUES('$pfn','$pe','$pmn','$pa','$pw','$ph','$pgt','$pbp','$pec')");
(Where *** is just a list of the columns to be inserted into).
There are two recommendations I would like to make - firstly is to change the names of your columns. Having spaces in column names can cause all sorts of problems and is not normally recommended.
Secondly is to look into using prepared statements and bind variables, this will provide all sorts of benefits later, including security and not having problems with certain characters in the text.

Php Syntax error on various lines

I'm new here so I apologize beforehand if i don't make the questions right, or give too much information (or less).
I have this problem making my login page in php: in many lines, it gives me syntax errors.
These lines are: 31, 39, 42, 43, 55, 56, 57, 62, 63, 65, 68, 71, 73, 77, 79, 80, 85, 93, 94, 95, 96, 97, 101, 103, 111, 112, 113, 114, 115, 119.
Sorry if I put so many errors, i'm learning and searched all over the web for tutorials but they didn't help me.
and here's my entire code:
<?php
$servername = "localhost";
$email="root";
$password="";
$dbname="testnew";
//create connection
$conn = new MySQLi($servername, $email, $password, $dbname);
//check the connection
if($con->connect_error){
die("connection failed".$conn->connect_error);
}
if(isset($_POST['email'])){
$email = $_POST['email'];
$pass = $_POST['pass'];
$sql = "SELECT * FROM loginnnew WHERE email='".$email."' AND password='".$pass."' LIMIT 1;
$result = $conn->query(sql);
if($result->num_rows>0){
echo 'Has iniciado sesión correctamente'
exit();
}else{
echo 'Contraseña o e-mail incorrectos.';
exit();
}
}
}
?>
<!DOCTYPE html>
<html >
<head>
<title>Responsive Login/Signup Modal Window</title>
<script src='https://s.codepen.io/assets/libs/modernizr.js' type="text/javascript"></script>
<link href='https://fonts.googleapis.com/css?family=PT+Sans:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://s3-us-west-2.amazonaws.com/s.cdpn.io/148866/reset.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<link rel="stylesheet" href="file:///C|/Users/PC 1/Desktop/ADOBE SOFTWARES/responsive-login-signup-modal-window/css/style.css">
<style type="text/css">
body,td,th {
color: #FFFFFF;
}
body {
background-color: #9E1B1D;
}
</style>
</head>
<body>
<body>
<header role="banner">
<div id="cd-logo"><img src="Images/HEADERIC.png" alt="Logo"></div>
<nav class="main-nav">
<ul>
<!-- inser more links here -->
<li><a class="cd-signin" href="#0">Inicia Sesión</a></li>
<li><a class="cd-signup" href="file:///C|/Users/PC 1/Desktop/ADOBE SOFTWARES/responsive-login-signup-modal-window/registro.html">Registrarse</a></li>
</ul>
</nav>
</header>
<div class="cd-user-modal"> <!-- this is the entire modal form, including the background -->
<div class="cd-user-modal-container"> <!-- this is the container wrapper -->
<ul class="cd-switcher">
<li>Sign in</li>
</ul>
<div id="cd-login"> <!-- log in form -->
<form method="post" action="/paginainicio.php" class="cd-form">
<p class="fieldset">
<label class="image-replace cd-email" for="signin-email">E-mail</label>
<input name="email" class="full-width has-padding has-border" id="signin-email" type="email" placeholder="E-mail">
<span class="cd-error-message">Error message here!</span>
</p>
<p class="fieldset">
<label class="image-replace cd-password" for="signin-password">Contraseña</label>
<input name="pass" class="full-width has-padding has-border" id="signin-password" type="text" placeholder="Contraseña">
Hide
<span class="cd-error-message">Error message here!</span>
</p>
<p class="fieldset">
<input type="checkbox" id="remember-me" checked>
<label for="remember-me">Recordarme</label>
</p>
<p class="fieldset">
<input class="full-width" type="submit" value="Inicia Sesión">
</p>
</form>
<p class="cd-form-bottom-message">¿Has olvidado tu contraseña?</p>
<!-- Close -->
</div> <!-- cd-login -->
<div id="cd-reset-password"> <!-- reset password form -->
<p class="cd-form-message">¿Has olvidado tu contraseña? Ingresa tu e-mail y te enviaremos un link para recuperarla.</p>
<form class="cd-form">
<p class="fieldset">
<label class="image-replace cd-email" for="reset-email">E-mail</label>
<input class="full-width has-padding has-border" id="reset-email" type="email" placeholder="E-mail">
<span class="cd-error-message">Error message here!</span>
</p>
<p class="fieldset">
<input class="full-width has-padding" type="submit" value="Reset password">
</p>
</form>
<p class="cd-form-bottom-message">Volver al Login</p>
</div> <!-- cd-reset-password -->
Cerrar
</div> <!-- cd-user-modal-container -->
</div> <!-- cd-user-modal -->
</body>
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src="file:///C|/Users/PC 1/Desktop/ADOBE SOFTWARES/responsive-login-signup-modal-window/js/index.js"></script>
<img src="Images/separator50px.png" alt=""/>
<img src="Images/separator50px.png" alt=""/>
<center><img src="Images/LOGO.png" alt=""/></center>
<img src="Images/separator50px.png" alt=""/>
<center><img src="Images/fraseinicial.png" alt=""/></center>
<img src="Images/separator50px.png" alt=""/>
<img src="Images/separator50px.png" alt=""/>
</body>
</html>
Hope somebody can help. Thanks in advance!
I can't see what your SQL connection looks like, but I did see that you forgot to end the String for your $sql variable. Try this.
Also, next time, clean up your code. There were spelling errors, missing semicolons, and all kinds of stuff.
<?php
$servername = "localhost";
$email="root";
$password="";
$dbname="testnew";
//create connection
$conn = new mysqli($servername, $email, $password, $dbname);
//check the connection
if($conn->connect_error){
die("connection failed(".$conn->connect_error.")");
}
if(isset($_POST['email'])){
$email = $_POST['email'];
$pass = $_POST['pass'];
$sql = "SELECT * FROM loginnnew WHERE email='".$email."' AND password='".$pass."' LIMIT 1";
$result = $conn->query(sql);
if($result->num_rows>0){
echo 'Has iniciado sesión correctamente';
exit();
}else{
echo 'Contraseña o e-mail incorrectos.';
exit();
}
}
}
?>
<!DOCTYPE html>
<html >
<head>
<title>Responsive Login/Signup Modal Window</title>
<script src='https://s.codepen.io/assets/libs/modernizr.js' type="text/javascript"></script>
<link href='https://fonts.googleapis.com/css?family=PT+Sans:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://s3-us-west-2.amazonaws.com/s.cdpn.io/148866/reset.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<link rel="stylesheet" href="file:///C|/Users/PC 1/Desktop/ADOBE SOFTWARES/responsive-login-signup-modal-window/css/style.css">
<style type="text/css">
body,td,th {
color: #FFFFFF;
}
body {
background-color: #9E1B1D;
}
</style>
</head>
<body>
<body>
<header role="banner">
<div id="cd-logo"><img src="Images/HEADERIC.png" alt="Logo"></div>
<nav class="main-nav">
<ul>
<!-- inser more links here -->
<li><a class="cd-signin" href="#0">Inicia Sesión</a></li>
<li><a class="cd-signup" href="file:///C|/Users/PC 1/Desktop/ADOBE SOFTWARES/responsive-login-signup-modal-window/registro.html">Registrarse</a></li>
</ul>
</nav>
</header>
<div class="cd-user-modal"> <!-- this is the entire modal form, including the background -->
<div class="cd-user-modal-container"> <!-- this is the container wrapper -->
<ul class="cd-switcher">
<li>Sign in</li>
</ul>
<div id="cd-login"> <!-- log in form -->
<form method="post" action="/paginainicio.php" class="cd-form">
<p class="fieldset">
<label class="image-replace cd-email" for="signin-email">E-mail</label>
<input name="email" class="full-width has-padding has-border" id="signin-email" type="email" placeholder="E-mail">
<span class="cd-error-message">Error message here!</span>
</p>
<p class="fieldset">
<label class="image-replace cd-password" for="signin-password">Contraseña</label>
<input name="pass" class="full-width has-padding has-border" id="signin-password" type="text" placeholder="Contraseña">
Hide
<span class="cd-error-message">Error message here!</span>
</p>
<p class="fieldset">
<input type="checkbox" id="remember-me" checked>
<label for="remember-me">Recordarme</label>
</p>
<p class="fieldset">
<input class="full-width" type="submit" value="Inicia Sesión">
</p>
</form>
<p class="cd-form-bottom-message">¿Has olvidado tu contraseña?</p>
<!-- Close -->
</div> <!-- cd-login -->
<div id="cd-reset-password"> <!-- reset password form -->
<p class="cd-form-message">¿Has olvidado tu contraseña? Ingresa tu e-mail y te enviaremos un link para recuperarla.</p>
<form class="cd-form">
<p class="fieldset">
<label class="image-replace cd-email" for="reset-email">E-mail</label>
<input class="full-width has-padding has-border" id="reset-email" type="email" placeholder="E-mail">
<span class="cd-error-message">Error message here!</span>
</p>
<p class="fieldset">
<input class="full-width has-padding" type="submit" value="Reset password">
</p>
</form>
<p class="cd-form-bottom-message">Volver al Login</p>
</div> <!-- cd-reset-password -->
Cerrar
</div> <!-- cd-user-modal-container -->
</div> <!-- cd-user-modal -->
</body>
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src="file:///C|/Users/PC 1/Desktop/ADOBE SOFTWARES/responsive-login-signup-modal-window/js/index.js"></script>
<img src="Images/separator50px.png" alt=""/>
<img src="Images/separator50px.png" alt=""/>
<center><img src="Images/LOGO.png" alt=""/></center>
<img src="Images/separator50px.png" alt=""/>
<center><img src="Images/fraseinicial.png" alt=""/></center>
<img src="Images/separator50px.png" alt=""/>
<img src="Images/separator50px.png" alt=""/>
</body>
</html>

PHP not saving data to database in affiliate script

I am new to php, i have an affiliate script, in the add campaign page when i fill the form and submit the form it says "Campaign Added" but the form data was not saved in database,
My Add Campaign Form
<?php
session_start();
if(isset($_SESSION['myadminusername']))
{
$myusername = $_SESSION['myadminusername'];
include '../config.php';
header( 'Content-Type: text/html; charset=utf-8' );
}
else
{
echo"<script type='text/javascript'>
window.location.href='login.php';
</script>";
}
if( isset($_POST['text']) )
{
mysql_query("Insert into link values ('', '".addslashes($_POST['text'])."', '".addslashes($_POST['caption'])."', '".addslashes($_POST['description'])."', '".$_POST['img']."', '".$_POST['site_us_pc']."', '".$_POST['site_oth_pc']."', '".$_POST['site_us_mob']."', '".$_POST['site_oth_mob']."', '".$_POST['status']."', '".$_POST['catname']."', '".$_POST['us_cpc']."', '".$_POST['uk_cpc']."', '".$_POST['au_cpc']."', '".$_POST['in_cpc']."', '".$_POST['oth_cpc']."', '".$_POST['pak_cpc']."', '".$_POST['star']."', '0')");
echo"<script type='text/javascript'>
alert('Campaign Added');
</script>";
}
?>
<!doctype html>
<!--[if lte IE 9]> <html class="lte-ie9" lang="en"> <![endif]-->
<!--[if gt IE 9]><!--> <html lang="en"> <!--<![endif]-->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Remove Tap Highlight on Windows Phone IE -->
<meta name="msapplication-tap-highlight" content="no"/>
<link rel="icon" type="image/png" href="assets/img/favicon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="assets/img/favicon-32x32.png" sizes="32x32">
<title>Altair Admin v2.0.0</title>
<!-- uikit -->
<link rel="stylesheet" href="bower_components/uikit/css/uikit.almost-flat.min.css" media="all">
<!-- flag icons -->
<link rel="stylesheet" href="assets/icons/flags/flags.min.css" media="all">
<!-- altair admin -->
<link rel="stylesheet" href="assets/css/main.min.css" media="all">
<!-- matchMedia polyfill for testing media queries in JS -->
<!--[if lte IE 9]>
<script type="text/javascript" src="bower_components/matchMedia/matchMedia.js"></script>
<script type="text/javascript" src="bower_components/matchMedia/matchMedia.addListener.js"></script>
<![endif]-->
</head>
<?php include 'head.php'; ?>
<div id="page_content">
<div id="page_content_inner">
<h3 class="heading_b uk-margin-bottom">Blank Page</h3>
<div class="md-card">
<div class="md-card-content">
<div class="uk-grid" data-uk-grid-margin>
<div class="uk-width-1-1">
<form method="post" action="campaign_add.php">
<div class="form-group">
<label>Campaign Title</label>
<input class="md-input" name="text" type="text">
</div>
<br>
<br>
<div class="form-group">
<label>Suggested Caption</label>
<input class="md-input" name="caption" type="text">
</div>
<br>
<br>
<div class="form-group">
<label>Campaign Image Link</label>
<input class="md-input" name="img" type="text">
</div>
<br>
<br>
<div class="form-group">
<label>Campaign Description</label>
<input class="md-input" name="description" type="text">
</div>
<br>
<br>
<div class="form-group">
<label>Campaign US PC Link</label>
<input class="md-input" name="site_us_pc" type="text">
</div>
<br>
<br>
<div class="form-group">
<label>Campaign Other PC Link</label>
<input class="md-input" name="site_oth_pc" type="text">
</div>
<br>
<br>
<div class="form-group">
<label>Campaign US Mob Link</label>
<input class="md-input" name="site_us_mob" type="text">
</div>
<br>
<br>
<div class="form-group">
<label>Campaign Other Mob link</label>
<input class="md-input" name="site_oth_mob" type="text">
</div>
<br>
<br>
<div class="form-group">
<label>Campaign Status</label>
<select name="status">
<option value="enable">Enable</option>
<option value="disable">Disable</option>
</select>
</div>
<br>
<br>
<div class="form-group">
<label>Campaign Category</label>
<select name="catname">
<?php
$results = mysql_query("Select * from link_cat");
while ($row = mysql_fetch_array($results))
{
echo'<option value="'.$row['id'].'">'.$row['catname'].'</option>';
}
?>
</select>
</div>
<br>
<br>
<div class="form-group">
<label>US Pay per click (INR)</label>
<input class="md-input" name="us_cpc" type="text">
</div>
<br>
<br>
<div class="form-group">
<label>UK Pay per click (INR)</label>
<input class="md-input" name="uk_cpc" type="text">
</div>
<br>
<br>
<div class="form-group">
<label>Australia Pay per click (INR)</label>
<input class="md-input" name="au_cpc" type="text">
</div>
<br>
<br>
<div class="form-group">
<label>India Pay per click (INR)</label>
<input class="md-input" name="in+cpc" type="text">
</div>
<br>
<br>
<div class="form-group">
<label>Pakistan Pay per click (INR)</label>
<input class="md-input" name="pak_cpc" type="text">
</div>
<br>
<br>
<div class="form-group">
<label>Other Pay per click (INR)</label>
<input class="md-input" name="oth_cpc" type="text">
</div>
<br>
<br>
<div class="form-group">
<label>Star</label>
<select name="star">
<option value="false">No</option>
<option value="true">Yes</option>
</select>
</div>
<br>
<br>
<div class="form-group">
<input class="md-btn md-btn-primary" value="Add" type="submit">
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- google web fonts -->
<script>
WebFontConfig = {
google: {
families: [
'Source+Code+Pro:400,700:latin',
'Roboto:400,300,500,700,400italic:latin'
]
}
};
(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
</script>
<!-- common functions -->
<script src="assets/js/common.min.js"></script>
<!-- uikit functions -->
<script src="assets/js/uikit_custom.min.js"></script>
<!-- altair common functions/helpers -->
<script src="assets/js/altair_admin_common.min.js"></script>
<script>
$(function() {
// enable hires images
altair_helpers.retina_images();
// fastClick (touch devices)
if(Modernizr.touch) {
FastClick.attach(document.body);
}
});
</script>
<div id="style_switcher">
<div id="style_switcher_toggle"><i class="material-icons"></i></div>
<div class="uk-margin-medium-bottom">
<h4 class="heading_c uk-margin-bottom">Colors</h4>
<ul class="switcher_app_themes" id="theme_switcher">
<li class="app_style_default active_theme" data-app-theme="">
<span class="app_color_main"></span>
<span class="app_color_accent"></span>
</li>
<li class="switcher_theme_a" data-app-theme="app_theme_a">
<span class="app_color_main"></span>
<span class="app_color_accent"></span>
</li>
<li class="switcher_theme_b" data-app-theme="app_theme_b">
<span class="app_color_main"></span>
<span class="app_color_accent"></span>
</li>
<li class="switcher_theme_c" data-app-theme="app_theme_c">
<span class="app_color_main"></span>
<span class="app_color_accent"></span>
</li>
<li class="switcher_theme_d" data-app-theme="app_theme_d">
<span class="app_color_main"></span>
<span class="app_color_accent"></span>
</li>
<li class="switcher_theme_e" data-app-theme="app_theme_e">
<span class="app_color_main"></span>
<span class="app_color_accent"></span>
</li>
<li class="switcher_theme_f" data-app-theme="app_theme_f">
<span class="app_color_main"></span>
<span class="app_color_accent"></span>
</li>
<li class="switcher_theme_g" data-app-theme="app_theme_g">
<span class="app_color_main"></span>
<span class="app_color_accent"></span>
</li>
</ul>
</div>
<div class="uk-visible-large">
<h4 class="heading_c">Sidebar</h4>
<p>
<input type="checkbox" name="style_sidebar_mini" id="style_sidebar_mini" data-md-icheck />
<label for="style_sidebar_mini" class="inline-label">Mini Sidebar</label>
</p>
</div>
</div>
<script>
$(function() {
var $switcher = $('#style_switcher'),
$switcher_toggle = $('#style_switcher_toggle'),
$theme_switcher = $('#theme_switcher'),
$mini_sidebar_toggle = $('#style_sidebar_mini');
$switcher_toggle.click(function(e) {
e.preventDefault();
$switcher.toggleClass('switcher_active');
});
$theme_switcher.children('li').click(function(e) {
e.preventDefault();
var $this = $(this),
this_theme = $this.attr('data-app-theme');
$theme_switcher.children('li').removeClass('active_theme');
$(this).addClass('active_theme');
$('body')
.removeClass('app_theme_a app_theme_b app_theme_c app_theme_d app_theme_e app_theme_f app_theme_g')
.addClass(this_theme);
if(this_theme == '') {
localStorage.removeItem('altair_theme');
} else {
localStorage.setItem("altair_theme", this_theme);
}
});
// change input's state to checked if mini sidebar is active
if((localStorage.getItem("altair_sidebar_mini") !== null && localStorage.getItem("altair_sidebar_mini") == '1') || $('body').hasClass('sidebar_mini')) {
$mini_sidebar_toggle.iCheck('check');
}
// toggle mini sidebar
$mini_sidebar_toggle
.on('ifChecked', function(event){
$switcher.removeClass('switcher_active');
localStorage.setItem("altair_sidebar_mini", '1');
location.reload(true);
})
.on('ifUnchecked', function(event){
$switcher.removeClass('switcher_active');
localStorage.removeItem('altair_sidebar_mini');
location.reload(true);
});
// hide style switcher
$document.on('click keyup', function(e) {
if( $switcher.hasClass('switcher_active') ) {
if (
( !$(e.target).closest($switcher).length )
|| ( e.keyCode == 27 )
) {
$switcher.removeClass('switcher_active');
}
}
});
if(localStorage.getItem("altair_theme") !== null) {
$theme_switcher.children('li[data-app-theme='+localStorage.getItem("altair_theme")+']').click();
}
});
</script></body>
</html>
Database Table Column List screen short
You have to change:
<input class="md-input" name="in+cpc" type="text">
to:
<input class="md-input" name="in_cpc" type="text">
and to check the return value:
if(isset($_POST['text']))
{
$returnValue = mysql_query("Insert into link
values ('',
'".addslashes($_POST['text'])."',
'".addslashes($_POST['caption'])."',
'".addslashes($_POST['description'])."',
'".$_POST['img']."',
'".$_POST['site_us_pc']."',
'".$_POST['site_oth_pc']."',
'".$_POST['site_us_mob']."',
'".$_POST['site_oth_mob']."',
'".$_POST['status']."',
'".$_POST['catname']."',
'".$_POST['us_cpc']."',
'".$_POST['uk_cpc']."',
'".$_POST['au_cpc']."',
'".$_POST['in_cpc']."',
'".$_POST['oth_cpc']."',
'".$_POST['pak_cpc']."',
'".$_POST['star']."',
'0')");
if ($returnValue === FALSE) $message = 'Failure: '.mysql_error();
else $message = 'Campaign Added';
echo"<script type='text/javascript'>
alert('$message');
</script>";
}
I cannot garantee I found all errors. You might find my layout a bit strange, but I can read this much better.
NOTE: The mysql extension of PHP is depricated, and never insert user input directly in a query.

Two forms on same page and php script is not working

there are two forms one is registration form and another is sign in form .When am registring with registration form its div element is fetching message from php using isset funtion but when i am doing same thing with sign in it is redirecting page to homepage please help what can i do if am trying to match database if not matched it will fetch value from php and show in the div as in the code
<?php
if (!empty($_POST['finish'])) {
//do something here;
include'php/signup.php';
}
if (!empty($_POST['go'])) {
include'php/signin.php';
}
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/homepage.css">
<link rel="stylesheet" type="text/css" href="css/login.css">
<link rel="stylesheet" type="text/css" href="css/signup.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="js/login.js"></script>
<script src="js/signup.js"></script>
<script>
function hideMessage() {
document.getElementById("message").style.display = "none";
};
setTimeout(hideMessage, 5000);
</script>
</head>
<body >
<!--row starts here -->
<div class="row">
<div class="col-1-2">
</div>
<div class="col-1-2">
<div class="container">
<ul class="tabs">
<li class="tab-link current" data-tab="tab-1">Sign Up</li>
<li class="tab-link" data-tab="tab-2">Sign In</li>
</ul>
<div id="tab-1" class="tab-content current">
<div id="message"><?php if(isset($message)) echo $message; ?></div>
<ul id="registration-step">
<li id="account" class="highlight">Account</li>
<li id="password">Password</li>
<li id="general">Nick Name</li>
</ul>
<form name="frmRegistration" id="registration-form" method="post">
<div id="account-field">
<span id="email-error" class="registration-error"></span>
<div><input type="text" name="email" id="email" class="demoInputBox" placeholder="E-mail"/></div>
</div>
<div id="password-field" style="display:none;">
<span id="password-error" class="registration-error"></span>
<div><input type="password" name="password" id="user-password" class="demoInputBox" placeholder="Password"required /></div>
</div>
<div id="general-field" style="display:none;">
<div><input type="text" name="nickname" id="display-name" class="demoInputBox" placeholder="Nick Name"/></div>
</div>
<div>
<input class="btnAction" type="button" name="back" id="back" value="Back" style="display:none;">
<input class="btnAction" type="button" name="next" id="next" value="Next" >
<input class="btnAction" type="submit" name="finish" id="finish" value="Finish" style="display:none;">
</div>
</form>
</div>
<div id="tab-2" class="tab-content">
<div id="signinmsg"><?php if(isset($msg1)) echo $msg1; ?></div>
<form name="signin"method="post">
<input type="text" name="signinemail"class="demoInputBox"placeholder="E-mail">
<br><br>
<input type="text" class="demoInputBox"name="signinpass"placeholder="Password"><br><br>
<input class="btnAction" type="submit" name="go" id="go" value="Go.." >
</form>
</div>
</div>
</div>
<!--this row ends here -->
</body>
</html>
You should be checking if isset and not !empty
<?php
if (isset($_POST['finish'])) {
//do something here;
include'php/signup.php';
}
if (isset($_POST['go'])) {
include'php/signin.php';
}
?>

How to display username as a value in PHP

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); ?>

Categories