I am having a problem getting back to my page with a unique id after processing a data
this first part of the code is redirecting into the page getting the unique id of the folder
<img src="<?= $row['folderimage'];?>" onerror="this.src='images/folder.png'" class="card-img-top" height="160" >
<div class="card-img">
<h6 style="text-align: center;"><?= $row['foldername'];?></h6>
this is the folder.php with unique id
<?php
require'config.php';
session_start();
if(isset($_GET['fldid'])){
$folder_id=$_GET['fldid'];
$sql="SELECT * FROM file_folder WHERE id='$folder_id'";
$result=mysqli_query($conn,$sql);
$row=mysqli_fetch_array($result);
$folder_name=$row['foldername'];
}
?>
<!DOCTYPE html>
<html>
<head>
<title>BSU</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="file.css">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" ><!-- FOR FONT AWESOME ICON-->
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"><!-- for css bootsrap 4 -->
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!-- Popper JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body class="bdy">
<div class="container-fluid">
<div class="row">
<div class="col-lg-3">
<hr>
<ul class="list-group">
<li class="list-group-item">
<div class="form-check">
<button class="btn btn-primary btn-lg btn-block" onclick="openFormfld()">Add Folde with Link</button>
</div>
</li>
<!-- para mag pop up ang add file form-->
<div class="form-popup" id="myFolderForm">
<form action="process.php" method="POST" enctype="multipart/form-data" class="form-container">
<!-- para ma notify if success or may error sa pag add ng file-->
<div style="display:<?php if(isset($_SESSION['showFilerror'])){echo $_SESSION['showFilerror'];}else { echo'none'; } unset($_SESSION['showFilerror']); ?>"
class="alert alert-danger alert-dismissible text-center mt-3">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong><?php if(isset($_SESSION['filemess'])){echo $_SESSION['filemess'];} unset($_SESSION['showFilerror']); ?></strong>
</div>
<!-- end of notif -->
<input type="hidden" name="folderid" value="<?= $folder_id; ?>">
<label for="folder"><b>Folder</b></label>
<input type="text" placeholder="Enter Folder Name" name="fldname"required>
<label for="link"><b>Link</b></label>
<input type="text" placeholder="Enter Link" name="link" required>
<label for="image"><b>Image For Folder</b></label>
<input type="file" name="image">
<button style="margin-top: 15px;" type="submit" name="folderlinkbtn" class="btn btnsub">Save</button>
Close
</form>
</div>
</ul>
</div>
<!-- para ma display ang folders -->
<div class="col-lg-9">
<!-- para ma notify pag successfull pag update-->
<div style="display:<?php if(isset($_SESSION['showAlert'])){echo $_SESSION['showAlert'];}else { echo'none'; } unset($_SESSION['showAlert']); ?>"
class="alert alert-success alert-dismissible text-center mt-3">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong><?php if(isset($_SESSION['message'])){echo $_SESSION['message'];} unset($_SESSION['showAlert']); ?></strong>
</div>
<!-- para ma notify pag hinde successfull pag update-->
<div style="display:<?php if(isset($_SESSION['showError'])){echo $_SESSION['showError'];}else { echo'none'; } unset($_SESSION['showError']); ?>"
class="alert alert-danger alert-dismissible text-center mt-3">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong><?php if(isset($_SESSION['error'])){echo $_SESSION['error'];} unset($_SESSION['showError']); ?></strong>
</div>
<!-- end of notif -->
<h5 class="text-center" id="textChange"><?= $folder_name; ?> Folder</h5>
<hr>
<div class="row" id="result">
<?php
$sql="SELECT * FROM folder_link WHERE folder_id='$folder_id'";
$result=$conn->query($sql);
while($row=$result->fetch_assoc()){
?>
<div class="col-md-3 mb-2">
<div class="card-deck">
<div style="background-color:#f3f4ed " class="card border-secondary">
<div class="btn-group">
<button style="float: right;" class="btn btn-success dropdown-toggle" id="showhidereply" data-toggle="dropdown" aria-haspopup="true" data-id="<?= $row['id'];?>"></button>
<div class="dropdown-menu" id="replycomment-<?= $row['id'];?>">
<a class="dropdown-item refold" data-id="<?= $row['id'];?>" >Rename Folder</a>
<a class="dropdown-item chgimg" data-id="<?= $row['id'];?>" >Change Folder Picture</a>
Delete Folder
</div>
</div>
<img src="<?= $row['folder_image'];?>" onerror="this.src='images/folder.png'" class="card-img-top" height="160" >
<div class="card-img">
<h6 style="text-align: center;"><?= $row['folder_name'];?></h6>
<!-- para sa update folder name pop up-->
<div class="pop-up" id="upd-<?= $row['id'];?>">
<div class="popup-content">
<form action="process.php" method="POST">
<p style="text-align: center;">Rename Folder</p>
<input type="hidden" name="idd" value="<?= $row['id'];?>">
<input class="newfold" type="text" name="updatefolder" placeholder="Enter New Folder Name" required>
Close
<button type="submit" name="updatebtnfld" class="btn popbtn">Update</button>
</form>
</div>
</div>
<!-- end sa update folder name pop up-->
<!-- para mapalitan ang image folder pop up-->
<div class="pop-up" id="img-<?= $row['id'];?>">
<div class="popup-content">
<form action="process.php" method="POST" enctype="multipart/form-data">
<p style="text-align: center;">Change Folder Iamge</p>
<input type="hidden" name="idd" value="<?= $row['id'];?>">
<input type="file" name="image" required>
Close
<button type="submit" name="updimgfld" class="btn popbtn">Update</button>
</form>
</div>
</div>
<!-- end sa update link pop up-->
</div>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
<!-- end sa folders display-->
</div>
</div>
this code below is my problem I don't what should I add in header to get me back in the page with unique id
if(isset($_POST['folderlinkbtn'])){
$fldid = $_POST['folderid'];
$fol = $_POST['fldname'];
$lin = $_POST['link'];
$image='images/'.$_FILES['image']['name'];
$target_dir="images/";
$target_file=$target_dir.basename($_FILES['image']['name']);
move_uploaded_file($_FILES['image']['tmp_name'],$target_file);
$sql="SELECT folder_id FROM folder_link WHERE folder_name ='$fol' LIMIT 1";
$check_query =mysqli_query($conn,$sql);
$count_folder = mysqli_num_rows($check_query);
if($count_folder>0){
$_SESSION['showFilerror']= 'block';
$_SESSION['filemess']="Sorry Folder Name Already Exist";
header('location:folder.php');}
else{
$sql ="INSERT INTO folder_link (folder_id,folder_links,folder_name,folder_image)VALUES('$fldid','$lin','$fol','$target_file')";
$run_query=mysqli_query($conn,$sql);
if($run_query){
$_SESSION['showAlert']= 'block';
$_SESSION['message']="Add File Successful";
header('location:folder.php');
}
else{
$_SESSION['showFilerror']= 'block';
$_SESSION['filemess']="ERROR</strong>";
header('location:folder.php');
}
}
}
if the processing requires redirecting to another page then include the unique ID in the url using GET method then include it in header function on php
I already fix the problem thanks in giving me an idea i just put
header( "Location: folder.php?fldid={$fldid}" );
Related
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Resident Information</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="dashboard.css" rel="stylesheet">
<link rel="stylesheet" href="resident_information.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php>">Barangay Awit Sayo</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li>Log Out</li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-sm-3 col-md-2 sidebar">
<ul class="nav nav-sidebar">
<li class="active">Dashboard <span class="sr-only">(current)</span></li>
<li>Barangay Officials</li>
<li>Resident Information</li>
<li>Mision & Vision</li>
</ul>
<ul class="nav nav-sidebar">
<li class="active">Documents</li>
<li>Barangay Clearance</li>
<li>Certificate of Residency</li>
<li>Certificate of Indigency</li>
</ul>
<ul class="nav nav-sidebar">
<li class="active">Reports and Schedules</li>
<li>Blotter Records</li>
<li>Settlement Schedules</li>
</ul>
</div>
<!-- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -->
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<h1 class="page-header">Resident Information</h1>
<div class="table-wrapper">
<div class="table-title">
<div class="row">
<div class="col-sm-13">
<i class="material-icons"></i> <span>Add New Resident</span>
</div>
</div>
</div>
<?php
require "config.php";
$sql="SELECT * FROM resident";
$sql_run= mysqli_query($conn, $sql);
?>
<table class="table table-striped table-hover">
<thead>
<tr>
<th>ID</th>
<th>Last Name</th>
<th>First Name</th>
<th>Gender</th>
<th>Age</th>
<th>Civil Status</th>
<th>Address</th>
<th>Contact No.</th>
<th>Action</th>
</tr>
</thead>
<?php
if ($sql_run) {
foreach ($sql_run as $row) {
?>
<tbody>
<tr>
<td><?php echo $row['user_id']; ?></td>
<td><?php echo $row['user_lname']; ?></td>
<td><?php echo $row['user_fname']; ?></td>
<td><?php echo $row['user_gender']; ?></td>
<td><?php echo $row['user_age']; ?></td>
<td><?php echo $row['user_cstat']; ?></td>
<td><?php echo $row['user_address']; ?></td>
<td><?php echo $row['user_contactno']; ?></td>
<td>
<i class="material-icons" data-toggle="tooltip" title="Edit"></i>
<i class="material-icons" data-toggle="tooltip" title="Delete"></i>
</td>
</tr>
</tbody>
<?php
}
}else {
echo "No Record Found";
}
?>
</table>
<div class="clearfix">
<div class="hint-text">Showing <b>5</b> out of <b>25</b> entries</div>
<ul class="pagination">
<li class="page-item disabled">Previous</li>
<li class="page-item">1</li>
<li class="page-item">2</li>
<li class="page-item active">3</li>
<li class="page-item">4</li>
<li class="page-item">5</li>
<li class="page-item">Next</li>
</ul>
</div>
</div>
</div>
<!-- add Modal HTML -->
<div id="addEmployeeModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Add Resident</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form action="insertcode.php" method="POST">
<div class="modal-body">
<div class="form-group">
<label>First Name</label>
<input type="text" name="txtfname" class="form-control" placeholder="Enter First Name" required>
</div>
<div class="form-group">
<label>Last Name</label>
<input type="text" name="txtlname" class="form-control" placeholder="Enter Last Name" required>
</div>
<div class="form-group">
<label>Gender</label>
<input type="text" name="txtgender" class="form-control" placeholder="Enter Gender" required>
</div>
<div class="form-group">
<label>Age</label>
<input type="text" name="txtage" class="form-control" placeholder="Enter Age" required>
</div>
<div class="form-group">
<label>Civil Status</label>
<input type="text" name="txtcstat" class="form-control" placeholder="Enter Civil Status" required>
</div>
<div class="form-group">
<label>Address</label>
<textarea class="form-control" name="txtaddress" placeholder="Enter Address" required></textarea>
</div>
<div class="form-group">
<label>Contact No.</label>
<input type="text" name="txtcontactno" class="form-control" placeholder="Enter Contact No." required>
</div>
</div>
<div class="modal-footer">
<input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel">
<input type="submit" name="insertdata" class="btn btn-success" value="Add" >
</div>
</form>
</div>
</div>
</div>
<!-- Edit Modal HTML -->
<div id="editEmployeeModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Edit Resident</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form action="updatecode.php" method="POST">
<div class="modal-body">
<input type="hidden" name="update_id" id="update_id">
<div class="form-group">
<label>First Name</label>
<input type="text" name="txtfname" id="txtfname" class="form-control">
</div>
<div class="form-group">
<label>Last Name</label>
<input type="text" name="txtlname" id="txtlname" class="form-control">
</div>
<div class="form-group">
<label>Gender</label>
<input type="text" name="txtgender" id="txtgender" class="form-control">
</div>
<div class="form-group">
<label>Age</label>
<input type="text" name="txtage" id="txtage" class="form-control">
</div>
<div class="form-group">
<label>Civil Status</label>
<input type="text" name="txtcstat" id="txtcstat" class="form-control">
</div>
<div class="form-group">
<label>Address</label>
<input type="text" name="txtaddress" id="txtaddress" class="form-control">
</div>
<div class="form-group">
<label>Contact No.</label>
<input type="text" name="txtcontactno" id="txtcontactno" class="form-control">
</div>
</div>
<div class="modal-footer">
<input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel">
<input type="submit" name="updatedata" class="btn btn-info editbtn" value="Save">
</div>
</form>
</div>
</div>
</div>
<!-- Delete Modal HTML -->
<div id="deleteEmployeeModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Delete Resident</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form action="deletecode.php" method="GET">
<div class="modal-body">
<p>Are you sure you want to delete these Records?</p>
<p class="text-warning"><small>This action cannot be undone.</small></p>
</div>
<div class="modal-footer">
<input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel">
<input type="submit" name="deletedata" class="btn btn-danger" value="Delete">
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src ="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"> </script>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js#1.16.0/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<script>
$(document).ready(function() {
$('.editbtn').on('click', function() {
$('#editEmployeeModal').modal('show');
$tr = $(this).closest('tr');
var data = $tr.children("td").map(function() {
return $(this).text();
}).get();
console.log(data);
$('#update_id').val(data[0]);
$('#txtlname').val(data[1]);
$('#txtfname').val(data[2]);
$('#txtgender').val(data[3]);
$('#txtage').val(data[4]);
$('#txtcstat').val(data[5]);
$('#txtaddress').val(data[6]);
$('#txtcontactno').val(data[7]);
});
});
</script>
</body>
</html>
THIS IS THE PHP EDIT/UPDATE CODE
<?php
require "config.php";
if (isset($_POST['updatedata'])) {
$id=$_POST['update_id'];
$fname=$_POST['txtfname'];
$lname=$_POST['txtlname'];
$gender=$_POST['txtgender'];
$age=$_POST['txtage'];
$cstat=$_POST['txtcstat'];
$address=$_POST['txtaddress'];
$contactno=$_POST['txtcontactno'];
$sql="UPDATE resident SET user_fname='$fname',user_lname='$lname',user_gender='$gender',user_age='$age',user_cstat='$cstat',user_address='$address',user_contactno='$contactno' WHERE user_id='$id' ";
$sql_run=mysqli_query($conn,$sql);
if ($sql_run) {
header("location: resident_information.php");
}else {
echo $conn->error;
}
}
?>
THIS IS THE PHP DELETE CODE
<?php
require "config.php";
if (isset($_GET['deletedata'])) {
$id=$_GET['deletedata'];
$sql="DELETE FROM resident WHERE user_id=$id";
$sql_run=mysqli_query($conn,$sql);
if ($sql_run) {
header ('location: resident_information.php');
}
}
?>
THIS IS THE DATABASE:
The problem of this code is that the update and delete function is not working. I did not include the create PHP code because it is working as it used to be. I only include the update and delete code because they are the one that is no working. Thanks for the help.
THIS IS THE OUTPUT:
This question already has answers here:
How to fix "Headers already sent" error in PHP
(11 answers)
Closed 6 years ago.
I'm trying to create a login script, which generates a session after the user signed in, now the user would be redirected to a new url, sadly I receive the following error:
[Fri Sep 23 20:09:17.125738 2016] [fcgid:warn] [pid 27802] [client 91.97.73.183:12550] mod_fcgid: stderr: PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/pr0b.com/httpdocs/index.php:109) in /var/www/vhosts/pr0b.com/httpdocs/handling/classes/user_login_class.php on line 74, referer: http://pr0b.com/
My code looks like the following:
Index.php
<?php
require_once('handling/classes/database_class.php');
require_once('handling/classes/site_config_class.php');
require_once('handling/classes/main_class.php');
$site_config = new site_config_class();
$site_informations = new main_class();
$site_informations_response = $site_informations->class_handler();
?>
<!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">
<title><?php echo $site_config->site_title_home; ?></title>
<!-- Global stylesheets -->
<link href="https://fonts.googleapis.com/css?family=Roboto:400,300,100,500,700,900" rel="stylesheet" type="text/css">
<link href="assets/css/icons/icomoon/styles.css" rel="stylesheet" type="text/css">
<link href="assets/css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="assets/css/core.css" rel="stylesheet" type="text/css">
<link href="assets/css/components.css" rel="stylesheet" type="text/css">
<link href="assets/css/colors.css" rel="stylesheet" type="text/css">
<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css">
<!-- Core JS files -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="assets/js/core/libraries/bootstrap.min.js"></script>
<script type="text/javascript" src="assets/js/plugins/ui/nicescroll.min.js"></script>
<script type="text/javascript" src="assets/js/plugins/ui/drilldown.js"></script>
<script type="text/javascript" src="assets/js/pages/form_select2.js"></script>
<script type="text/javascript" src="assets/js/core/app.js"></script>
<script type="text/javascript" src="assets/js/plugins/forms/selects/select2.min.js"></script>
<script type="text/javascript" src="../assets/js/plugins/notifications/noty.min.js"></script>
</head>
<body class="navbar-top-md-md login-container">
<div class="navbar-fixed-top">
<div class="navbar navbar-inverse">
<div class="navbar-header">
<a class="navbar-brand" href="index.html"><div class="logo"></div></a>
<ul class="nav navbar-nav pull-right visible-xs-block">
<li><a data-toggle="collapse" data-target="#navbar-mobile"><i class="icon-tree5"></i></a></li>
</ul>
</div>
<div class="navbar-collapse collapse" id="navbar-mobile">
<ul class="nav navbar-nav navbar-right">
<li><a data-toggle="modal" data-target="#modal-registration"><i class="icon-users4 position-left"></i> Register Account</a></li>
<li><a data-toggle="modal" data-target="#modal-login"><i class="icon-user-lock position-left"></i> Log In</a></li>
<li><a data-toggle="modal" data-target="#modal-recover"><i class="icon-reply position-left"></i> Resend Credentials</a></li>
</ul>
</div>
</div>
<!-- /main navbar -->
<!-- Second navbar -->
<div class="navbar navbar-default" id="navbar-second">
<ul class="nav navbar-nav no-border visible-xs-block">
<li><a class="text-center collapsed" data-toggle="collapse" data-target="#navbar-second-toggle"><i class="icon-menu7"></i></a></li>
</ul>
<div class="navbar-collapse collapse" id="navbar-second-toggle">
<ul class="nav navbar-nav">
<li class="active"><i class="icon-home position-left"></i> Home</li>
<li><i class="icon-heart6 position-left"></i> Community</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><i class="icon-facebook2"></i></li>
<li><i class="icon-twitter"></i></li>
<li><i class="icon-youtube"></i></li>
</ul>
</div>
</div>
<!-- /second navbar -->
</div>
<!-- /fixed navbars wrapper -->
<!-- Page container -->
<div class="page-container">
<div class="page-content">
<div class="content-wrapper">
<div class="row">
<div class="col-lg-3">
<div class="panel bg-slate-400">
<div class="panel-body">
<div class="heading-elements">
<span class="heading-text badge bg-slate-300">Registered users</span>
</div>
<h3 class="no-margin"><?php echo $site_informations_response['registered_users']; ?></h3>
Registered users
</div>
</div>
</div>
<div class="col-lg-3">
<div class="panel bg-slate-400">
<div class="panel-body">
<div class="heading-elements">
<span class="heading-text badge bg-slate-300">Online users</span>
</div>
<h3 class="no-margin"><?php echo $site_informations_response['online_users']; ?></h3>
Online users
</div>
</div>
</div>
<div class="col-lg-3">
<div class="panel bg-slate-400">
<div class="panel-body">
<div class="heading-elements">
<span class="heading-text badge bg-slate-300">Male users</span>
</div>
<h3 class="no-margin"><?php echo $site_informations_response['male_users']; ?></h3>
Male users
</div>
</div>
</div>
<div class="col-lg-3">
<div class="panel bg-slate-400">
<div class="panel-body">
<div class="heading-elements">
<span class="heading-text badge bg-slate-300">Female users</span>
</div>
<h3 class="no-margin"><?php echo $site_informations_response['female_users']; ?></h3>
Female users
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
Content
</div>
</div>
<!-- Login form -->
<div id="modal-login" class="modal fade">
<div class="modal-dialog">
<div class="modal-content login-form">
<!-- Form -->
<form class="modal-body" method="post">
<div class="text-center">
<div class="icon-object border-slate-300 text-slate-300"><i class="icon-reading"></i></div>
<h5 class="content-group">Login to your account <small class="display-block">Your credentials</small></h5>
</div>
<div class="form-group has-feedback has-feedback-left">
<input type="text" class="form-control" placeholder="Username" name="username">
<div class="form-control-feedback">
<i class="icon-user text-muted"></i>
</div>
</div>
<div class="form-group has-feedback has-feedback-left">
<input type="text" class="form-control" placeholder="Password" name="password">
<div class="form-control-feedback">
<i class="icon-lock2 text-muted"></i>
</div>
</div>
<input type="hidden" name="action" value="login">
<div class="form-group">
<button type="submit" class="btn bg-slate-600 btn-block">Login</button>
<button type="button" class="btn btn-default btn-block" data-dismiss="modal">Cancel</button>
</div>
<span class="help-block text-center no-margin">By continuing, you're confirming that you've read our Terms & Conditions and Cookie Policy</span>
</form>
<!-- /form -->
</div>
</div>
</div>
<!-- /login form -->
<!-- Registration form -->
<div id="modal-registration" class="modal fade">
<div class="modal-dialog">
<div class="modal-content login-form">
<!-- Form -->
<form class="modal-body" method="post">
<div class="text-center">
<div class="icon-object border-slate-300 text-slate-300"><i class="icon-plus3"></i></div>
<h5 class="content-group">Create account <small class="display-block">All fields are required</small></h5>
</div>
<div class="content-divider text-muted form-group"><span>Your credentials</span></div>
<div class="form-group has-feedback has-feedback-left">
<input type="text" class="form-control" placeholder="Username" name="username">
<div class="form-control-feedback">
<i class="icon-user-check text-muted"></i>
</div>
</div>
<div class="form-group has-feedback has-feedback-left">
<input id="password" type="password" class="form-control" placeholder="Password" name="password">
<div class="form-control-feedback">
<i class="icon-user-lock text-muted"></i>
</div>
</div>
<div class="form-group has-feedback has-feedback-left">
<input id="password_confirm" type="password" class="form-control" placeholder="Repeat password" name="password_confirm">
<div class="form-control-feedback">
<i class="icon-user-lock text-muted"></i>
</div>
</div>
<div class="form-group">
<span id="password_status" class="help-block text-center no-margin"></span>
</div>
<div class="content-divider text-muted form-group"><span>Your privacy</span></div>
<div class="form-group has-feedback has-feedback-left">
<input type="text" class="form-control" placeholder="Email" name="email">
<div class="form-control-feedback">
<i class="icon-mention text-muted"></i>
</div>
</div>
<div class="form-group has-feedback has-feedback-left">
<input type="text" class="form-control" placeholder="Reset pin code" name="pin_code">
<div class="form-control-feedback">
<i class="icon-sync text-muted"></i>
</div>
</div>
<div class="form-group">
<select data-placeholder="Select a gender..." class="select" name="gender">
<option></option>
<option value="male">Male</option>
<option value="female">Female</option>
</select>
</div>
<div class="content-divider text-muted form-group"><span>Additions</span></div>
<div class="form-group">
<div class="checkbox">
<label>
<input type="checkbox" id="terms" class="styled" name="terms">Accept terms of service
</label>
</div>
</div>
<input type="hidden" name="action" value="register">
<div class="form-group">
<button id="registerButton" type="submit" class="btn bg-slate-600 btn-block" disabled>Register account</button>
<button type="button" class="btn btn-default btn-block" data-dismiss="modal">Cancel</button>
</div>
<span class="help-block text-center no-margin">By continuing, you're confirming that you've read our Terms & Conditions and Cookie Policy</span>
</form>
<!-- /form -->
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$("#password_confirm").keyup(validate);
});
$('#terms').change(function(){
$("#registerButton").prop('disabled', !$(this).is(':checked'));
});
function validate() {
var password1 = $("#password").val();
var password2 = $("#password_confirm").val();
if(password1 == password2) {
$("#password_status").text("Passwords match!");
}
else {
$("#password_status").text("Passwords do not match!");
}
}
</script>
<!-- /registration form -->
<!-- Password recovery form -->
<div id="modal-recover" class="modal fade">
<div class="modal-dialog">
<div class="modal-content login-form">
<!-- Form -->
<form class="modal-body" action="index.html">
<div class="text-center">
<div class="icon-object border-slate-300 text-slate-300"><i class="icon-spinner11"></i></div>
<h5 class="content-group">Password recovery <small class="display-block">We'll send you instructions in email</small></h5>
</div>
<div class="form-group has-feedback has-feedback-left">
<input type="text" class="form-control" placeholder="Username">
<div class="form-control-feedback">
<i class="icon-user-check text-muted"></i>
</div>
</div>
<div class="form-group has-feedback has-feedback-left">
<input type="text" class="form-control" placeholder="Reset pin code">
<div class="form-control-feedback">
<i class="icon-sync text-muted"></i>
</div>
</div>
<input type="hidden" name="action" value="recover">
<button type="submit" class="btn bg-slate-600 btn-block">Reset password</button>
<button type="button" class="btn btn-default btn-block" data-dismiss="modal">Cancel</button>
</form>
<!-- /form -->
</div>
</div>
</div>
<!-- /password recovery form -->
<?php
if(!empty($_POST)){
$action = $_POST['action'];
switch ($action) {
case 'login':
require_once('handling/classes/user_login_class.php');
$user_login = new user_login_class($_POST['username'], $_POST['password']);
$user_login_response = $user_login->class_handler();
echo $user_login_response;
break;
case 'register':
require_once('handling/classes/register_class.php');
$register_account = new register_class($_POST['username'], $_POST['password'], $_POST['password_confirm'], $_POST['email'], $_POST['pin_code'], $_POST['gender']);
$register_account_response = $register_account->class_handler();
echo $register_account_response;
break;
case 'recover':
#code
break;
}
}
?>
</div>
</div>
</div>
<!-- /Page container -->
<!-- Footer -->
<div class="footer text-muted text-center">
<?php echo $site_config->site_footer; ?>
</div>
<!-- /footer -->
</body>
</html>
user_login_class
<?php
class user_login_class extends database_class {
// Class constructor
function __construct($username, $password) {
$this->username = $username;
$this->password = $password;
$this->salt = 'zWorlDs4lt';
$this->hashed_password = md5($this->salt.$this->password);
}
// Function to check the user credentials
function check_user_credentials() {
$this->connect();
$result = $this->execute_query("SELECT password FROM Users WHERE username = '" . $this->username . "'");
while($row = mysqli_fetch_assoc($result)) {
$response = $row['password'];
}
if($response !== $this->hashed_password) {
return false;
}else {
return true;
}
}
// Function to check the account status
function get_account_status() {
$this->connect();
$result = $this->execute_query("SELECT status FROM Users WHERE username = '" . $this->username . "'");
while($row = mysqli_fetch_assoc($result)) {
$response = $row['status'];
}
return $response;
}
// Function to update user informations
function update_user_variables() {
$this->connect();
$result = $this->execute_query("UPDATE Users SET ip = '" . $_SERVER['REMOTE_ADDR'] . "', online = '1' WHERE username = '" . $this->username . "'");
if(!$result) {
return false;
}else {
return true;
}
}
// Function to execute the class
function class_handler() {
if(!$this->username) {
return 'Error: Username is required. Please enter a valid username.';
}else if(!$this->password) {
return 'Error: Password is required. Please enter a valid password.';
}else {
$check_account_status = $this->get_account_status();
if($check_account_status == 1) {
return 'Error: This account was banned. Please contact our support.';
}else {
$check_user_credentials_resonse = $this->check_user_credentials();
if($check_user_credentials_resonse == false) {
return 'Error: Wrong credentials. Please try again.';
}else if($check_user_credentials_resonse == true) {
$update_user = $this->update_user_variables();
if($update_user == false) {
return 'Error: Wrong credentials. Please try again.';
}else if($update_user == true) {
session_start();
$_SESSION['logged_in'] = true;
$_SESSION['username'] = $this->username;
header('Location: /zworld');
exit();
}
}
}
}
}
}
?>
But yea, it would not redirect the user, does anyone know why? I would appreciate any kind of help, cause I have no clue where to search.
at the very top of your script, put ob_start()
<?php
ob_start();
require_once('handling/classes/database_class.php');
require_once('handling/classes/site_config_class.php');
require_once('handling/classes/main_class.php');
$site_config = new site_config_class();
$site_informations = new main_class();
$site_informations_response = $site_informations->class_handler();
...
?>
I am using bootstrap 3 and I am making a social networking site, this code here is a part of a panel which shows the posts.The problem is it is showing the comments on toggle but the comments are not appearing within the footer it is crossing it...So what is wrong in my or how can I extend the panel footer?
Here's the code:
<div class="panel-footer">
Like <span class="glyphicon glyphicon-thumbs-up"></span>
Comments
<div id='toggleComment<?php echo $idp;?>' style="display:none;">
<form action="" method="POST"><!--FORM COMMENT-->
<div class="form-group">
<div class="rows" >
<div class="col-sm-1" style="padding-right:2px;">
<div class="compic">
<img src="<?php echo $profilepic; ?>" style="width:100%;height:100%;" />
</div>
</div>
<div class="col-sm-11" style="padding-left:3px; padding-bottom:7px">
<textarea class="form-control expandable pull-left" name="comment<?php echo $idp;?>" id="comment" placeholder="Write a comment..." required>
</textarea>
</div>
</div>
<hr>
<button type="submit" class="btn btn-primary pull-right" name="subcom<?php echo $idp;?>"><b>Comment</b></button>
<div class="clearfix"></div>
</div></form>
<div class="rows" >
<?php
$postid=$idp;
$postby=$id;
$postto=$uid;
if(isset($_POST['subcom'.$postid]))
{ $postbody=$_POST['comment'.$postid];
if($postbody!="")
{$res=mysqli_query($con,"INSERT INTO comment VALUES('','$postby','$postto','$postbody','$postid')");}
}
$show=mysqli_query($con,"SELECT * FROM comment WHERE postid='$idp' ORDER by id");
while($show_row=mysqli_fetch_array($show))
{
$commentbyid=$show_row['cby'];
$combody=$show_row['cbody'];
$cbyquery=mysqli_query($con,"SELECT * FROM user WHERE id='$commentbyid'") or die(mysqli_error($con));
$cby=mysqli_fetch_array($cbyquery);
$cpic=$cby['profpic'];
if ($cpic== "" || !file_exists("userdata/profile_pics/$cpic"))
{
$cpic = "images/default_pic.jpg";
}
else
{
$cpic = "userdata/profile_pics/".$cpic;
}
$cname=ucfirst(strtolower($cby[1]));
$csname=ucfirst(strtolower($cby[2]));
?>
<div class="col-sm-1" style="padding-right:2px;">
<div class="compic">
<img src="<?php echo $cpic; ?>" style="width:100%;height:100%;" />
</div>
</div>
<div class="col-sm-11" style="padding-left:3px;">
<?php echo $cname." ".$csname;?><br>
<?php echo $combody;?>
</div>
<?php
}
?></div>
</div><!--Toggle Ends here-->
</div>
finally got it it was because of the <div class="clearfix"></div> and it got solved when I used it just after </div><!--Toggle Ends here-->
I just started learning php and my first project was to make a working contact form. I have typed up what I could, but for some reason there appears to be some sort of errors that php is not telling me. I have looked for solutions to the issue on another web forum like phpacademy, and to no avail. I finally came to try out stack overflow, since I have heard great things about this forum. Any help is appreciated, and thanks in advance.
<!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">
<title>Contact</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/styles.css"/>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't websites if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<?php
if ($_POST['submit']){
if(!$_POST['firstname']){
$error='<br /> Please Enter your first name';
}
if(!$_POST['lastname']){
$error='<br /> Please Enter your last name';
}
if(!$_POST['email']){
$error='<br /> Please Enter your email address';
}
if(!$_POST['phone']){
$error='<br /> Please Enter your phone number';
}
if(!$_POST['message']){
$error='<br /> Please Enter your message you would like to send';
}
if($_POST['email']!="" and !filter_var($_POST['email'],
FILTER_VALIDATE_EMAIL)){
$error.='<br /> Please enter a valid email address';
}
if($error){
$result='<div class="alert alert-danger"><strong>One or more errors has occurred</strong>'.$error.'</div>';
}
else {
if (mail("casey#caseywoelfle.com", "Potential Client!", "FirstName: " .
$_POST['firstname'] . "
LastName ".$_POST['lastname'] ."
Email: " .$_POST['email'] . "
Phone: ".$_POST['phone'] . "
Comment: ".$_POST['comment'])) {
$result = '<div class="alert alert-success"><strong>Thank you!</strong>I\'ll be in touch within 2 business days.</div>';
} else {
$result = '<div class="alert alert-danger"> Sorry, there was an error sending your message. Please try again later.</div>';
}
}
}
?>
<nav class="navbar">
<div class="container-full">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand honey-sb" href="#">CW</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li><a class="nLink" href="index.html">Home</a></li>
<li><a class="nLink" href="about.html">About</a></li>
<li><a class="nLink" href="portfolio.html">Portfolio</a></li>
<li><a class="nLink" href="contact.php">Contact</a></li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row contact-sec">
<div class="col-md-12">
<form class="form-horizontal" method="post">
<div class="well">
<h1 class="text-center header">Contact Me</h1>
<h3 class="text-center">
Do you have a project you would like me to take a look at or maybe you have an idea?<br/>Either
way don’t hesitate to send me an email using the contact form or give me a call.
</h3>
</div>
<div class="form-group">
<span class="col-md-1 col-md-offset-2 text-center"><i class="glyphicon glyphicon-user"></i></span>
<div class="col-md-6">
<input id="InputFirstName" name="firstname" type="text" placeholder="First Name" class="form-control">
</div>
</div>
<div class="form-group">
<span class="col-md-1 col-md-offset-2 text-center"><i class="glyphicon glyphicon-user"></i></span>
<div class="col-md-6">
<input id="InputLastName" name="lastname" type="text" placeholder="Last Name" class="form-control">
</div>
</div>
<div class="form-group">
<span class="col-md-1 col-md-offset-2 text-center"><i class="glyphicon glyphicon-envelope"></i></span>
<div class="col-md-6">
<input id="InputEmail" name="email" type="text" placeholder="Email Address" class="form-control">
</div>
</div>
<div class="form-group">
<span class="col-md-1 col-md-offset-2 text-center"><i class="glyphicon glyphicon-earphone"></i></span>
<div class="col-md-6">
<input id="InputPhone" name="phone" type="text" placeholder="Phone" class="form-control">
</div>
</div>
<div class="form-group">
<span class="col-md-1 col-md-offset-2 text-center"><i class="glyphicon glyphicon-pencil"></i></span>
<div class="col-md-6">
<textarea class="form-control" id="InputMessage" name="message" placeholder="Enter your massage for us here. We will get back to you within 2 business days." rows="7"></textarea>
</div>
</div>
<div class="well">
<div class="form-group">
<div class="col-sm-4 col-sm-offset-4 text-center">
<button type="submit" id="submit" name="submit" class="btn btn-primary btn-lg">Submit</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<footer>
<div class="container-fluid">
<div class="row" id="f-nav">
<div class="col-xs-6 col-sm-3 text-center" id="f-contact">
<h2 class="footerbolder">Contact</h2>
<img src="images/ph.png" class="img-responsive" alt=""/>
</div>
<div class="col-xs-6 col-sm-3 text-center" id="f-about">
<h2 class="footerbolder">About Us</h2>
<img src="images/ph.png" class="img-responsive" alt=""/>
</div>
<div class="col-xs-6 col-sm-3 text-center" id="f-services">
<h2 class="footerbolder">Services</h2>
<img src="images/ph.png" class="img-responsive" alt=""/>
</div>
<div class="col-xs-6 col-sm-3 text-center" id="f-follow">
<h2 class="footerbolder">Follow Me</h2>
<img src="images/ph.png" class="img-responsive" alt=""/>
</div>
</div>
<div class="row">
<div class="hidden-xs col-sm-12" id="pp-tos">
<div class="center-block text-center">
<a class="" href="#">Terms of Service</a>
<a>|</a>
<a class="" href="#">Privacy Policy</a>
</div>
</div>
</div>
</div>
</footer>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script src="js/Fittext/jquery.fittext.js"></script>
</body>
</html>
#B-and-P is right, if all your error checking validates, then your error variable is undefined by the time you reach your
if($error)
statement. To fix this, simply declare your error variable at the top to be null like
$error = NULL;
that way when you check for it, it is defined and if there is no errors, your script will send your mail.
There is no action attribute in your form tag. Example:
<form class="form-horizontal" method="post" action="send_form_email.php">
cut the PHP script from your code and put it in a separate file. Save as send_form_email.php
http://askguyson.com/simple-form-to-email-php-contact-form/
The following shows my HTML & PHP for most of the tags on the page including the while loop. It loops out all the rows in a sql table, the user should be able to click on the image and it opens up a modal to be able to crop that image. This works perfectly fine in the first item on the page (first sql row), but for all subsequent sql rows the modal does not open after clicking. How can I correct this or troubleshoot it?
I'm using Twit BS 3.2.0
<?php
ob_start();
session_start();
require_once ('verify.php');
?>
<head>
<title>Edit Listings</title>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<link href="../css/cropper.min.css" rel="stylesheet">
<link href="../css/crop-avatar.css" rel="stylesheet">
</head>
<body>
<div id="container">
<div id="head">
<ul id="menu">
</ul>
</div>
<div id="area"></div>
<div id="main_listings">
<h1 align="left">Edit listings page</h1>
<?php
include ("../dbcon2.php");
$conn = new mysqli($servername, $username, $password, $dbname);
$sql="SELECT * FROM listings ORDER BY date_added DESC";
$result = $conn->query($sql);
?>
<?php while ($data=mysqli_fetch_assoc($result)):
$id = $data['id'];
$title = $data['title'];
$listing_img = $data['listing_img'];
?>
<div id="edit_listing">
<div id="edit_left">
<div class="container" id="crop-avatar">
<div class="avatar-view" title="Change the avatar"> <img src="<?php echo $listing_img; ?>" alt="<?php echo $title; ?>"> </div>
<div class="modal fade" id="avatar-modal" tabindex="-1" role="dialog" aria-labelledby="avatar-modal-label" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<form class="avatar-form" method="post" action="edit-avatar.php" enctype="multipart/form-data">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title" id="avatar-modal-label">Listing Main Image</h4>
</div>
<div class="modal-body">
<div class="avatar-body">
<div class="avatar-upload">
<input class="avatar-src" name="avatar_src" type="hidden">
<input class="avatar-data" name="avatar_data" type="hidden">
<input name="avatar_id" type="hidden" value="<?php echo $id; ?>">
<label for="avatarInput">Local upload</label>
<input class="avatar-input" id="avatarInput" name="avatar_file" type="file">
</div>
<div class="row">
<div class="col-md-9">
<div class="avatar-wrapper"></div>
</div>
<div class="col-md-3">
<div class="avatar-preview preview-lg"></div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-default" type="button" data-dismiss="modal">Close</button>
<button class="btn btn-primary avatar-save" type="submit">Save</button>
</div>
</form>
</div>
</div>
</div>
<div class="loading" tabindex="-1" role="img" aria-label="Loading"></div>
</div>
</div>
<div id="edit_right">
<form name="edit_date" action="edit_list.php" method="post" id="edit_list_data">
<input name="title" type="text" id="title" tabindex="1" value="<?php echo $title; ?>" size="60" maxlength="57"/>
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<input type="submit" formaction="edit_list.php" value="Submit" />
</form>
</div>
</div>
<?php endwhile;$conn->close();?>
<div class="spacer"></div>
</div>
</div>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="../js/cropper.min.js"></script>
<script src="../js/crop-avatar.js"></script>
</body>
</html><?php // Flush the buffered output.
ob_end_flush();
?>
Try this. I have moved some things around and placed the bulk of the php before the initial html tag as well as placing the contents of the sql call into an array that is later used to build the images.
<?php
include ("../dbcon2.php");
ob_start();
session_start();
require_once ('verify.php');
$conn = new mysqli($servername, $username, $password, $dbname);
$sql="SELECT * FROM listings ORDER BY date_added DESC";
$result = $conn->query($sql);
$results = array();
while ($data = mysqli_fetch_assoc($result)){
$results[] = array(
'id' => $data['id'];
'title' => $data['title'];
'listing_img' => $data['listing_img'];
);
}
$conn->close();
?>
<html>
<head>
<title>Edit Listings</title>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<link href="../css/cropper.min.css" rel="stylesheet">
<link href="../css/crop-avatar.css" rel="stylesheet">
</head>
<body>
<div id="container">
<div id="head">
<ul id="menu">
</ul>
</div>
<div id="area"></div>
<div id="main_listings">
<h1 align="left">Edit listings page</h1>
<?php foreach($results as $row): ?>
<div id="edit_listing">
<div id="edit_left">
<div class="container" id="crop-avatar">
<div class="avatar-view" title="Change the avatar"><img src="<?php echo $row['listing_img']; ?>" alt="<?php echo $row['title']; ?>"> </div>
<div class="modal fade" id="avatar-modal" tabindex="-1" role="dialog" aria-labelledby="avatar-modal-label" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<form class="avatar-form" method="post" action="edit-avatar.php" enctype="multipart/form-data">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title" id="avatar-modal-label">Listing Main Image</h4>
</div>
<div class="modal-body">
<div class="avatar-body">
<div class="avatar-upload">
<input class="avatar-src" name="avatar_src" type="hidden">
<input class="avatar-data" name="avatar_data" type="hidden">
<input name="avatar_id" type="hidden" value="<?php echo $row['id']; ?>">
<label for="avatarInput">Local upload</label>
<input class="avatar-input" id="avatarInput" name="avatar_file" type="file">
</div>
<div class="row">
<div class="col-md-9">
<div class="avatar-wrapper"></div>
</div>
<div class="col-md-3">
<div class="avatar-preview preview-lg"></div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-default" type="button" data-dismiss="modal">Close</button>
<button class="btn btn-primary avatar-save" type="submit">Save</button>
</div>
</form>
</div>
</div>
</div>
<div class="loading" tabindex="-1" role="img" aria-label="Loading"></div>
</div>
</div>
<div id="edit_right">
<form name="edit_date" action="edit_list.php" method="post" id="edit_list_data">
<input name="title" type="text" id="title" tabindex="1" value="<?php echo $row['title']; ?>" size="60" maxlength="57"/>
<input type="hidden" name="id" value="<?php echo $row['id']; ?>" />
<input type="submit" formaction="edit_list.php" value="Submit" />
</form>
</div>
</div>
<?php endforeach; ?>
<div class="spacer"></div>
</div>
</div>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="../js/cropper.min.js"></script>
<script src="../js/crop-avatar.js"></script>
</body>
</html>
<?php // Flush the buffered output.
ob_end_flush();
?>