Image output from database - php

Im learn php,try develops a little blog for myself. I have a problem.When I pull information from the database, everything is displayed except the picture. In code i try save picture in img folder, there is an addition to the database, but there is no saving to the folder.And this is probably why there is no image output.
I ask for help. Sorry for my English. Thanks!
//AddPost
<?php
session_start();
require_once '../DB.php';
if($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['button-post'])) {
$error ='';
if (!empty($_FILES['img']['name'])){
$img = time() . "_" . $_FILES['img']['name'];
$fileTmpName = $_FILES['img']['tmp_name'];
$fileType = $_FILES['img']['type'];
$destination = "../img/" . $img;
if (strpos($fileType, 'image') === false) {
$error = "The uploaded file is not an image!!";
}else{
$result = move_uploaded_file($fileTmpName, $destination);
if ($result){
$_POST['img'] =$img ;
// tt( $img);
}else{
$error = " Error uploading image to server";
}
}
}else{
$error= "Error getting picture";
}
$title = trim( $_POST['title']);
$texton = trim( $_POST['texton']);
if (strlen($title) <= 2 ) {
$error = '';
}
elseif (strlen($texton)<= 5 ) {
$error = '';
}
else {
$sql = "INSERT INTO `posts`(`title`, `texton`, `img`) VALUES(?,?,?)";
$query = $connect->prepare($sql);
$query->execute([$title,$texton,$img]);
}
}
//index
<?php
require_once 'DB.php';
$sql = "SELECT * FROM `posts` ORDER BY`id`DESC";
$query = $connect->query($sql);
while ($row = $query->fetch(PDO::FETCH_OBJ)):
?>
<div class="titlePost col-12 col-md-9">
<h2>
<?=$row->title;?>
</h2>
<div class="imgPost col-12 col-md-4">
<img src="/img .<?= $row->img?>;" alt="postik">
</div>
<p> <?=$row->texton;?></p>
</div>
<?php endwhile; ?>
<form action="addPost_form.php" method="post" class="row justify-content-center">
<h2>Add Post</h2>
<div class="mb-3 col-12 col-md-4 err">
<p><?=$error?></p>
</div>
<div class="w-100"></div>
<div class="mb-3 col-12 col-md-6">
<label for="title">Title</label>
<input type="text" name="title" id="title" class="form-control">
</div>
<div class="w-100"></div>
<div class="mb-3 col-12 col-md-8">
<label for="texton">Сontent</label>
<textarea type="text" name="texton" id="texton" class="form-control" ></textarea>
</div>
<div class="w-100"></div>
<div class="mb-3 col-12 col-md-4">
<input name="img" enctype='multipart/form-data' type="file" class="form-control" id="img">
</div>
<div class="w-100"></div>
<div class="mb-3 col-12 col-md-4">
</div>
<div class="w-100"></div>
<div class="mb-3 col-12 col-md-4">
<button type="submit" class="btn btn-secondary" name="button-post">Add</button>
</div>
</form>

You don't need to use ../img; instead of just using /img, it will point out your root directory then the img folder. Another thing make sure $imgName has the image extension. If not, then concatenate the image extension with it. And it would be best if you stored the image extension on the database to read the image successfully. If image src directly does not print the image name and extension, you can store it separate variable, for example, $image = $imgName.'.'.$imgExt in this way.

Related

How to update the image name in SQL table and store it in the directory?

I wanted to update the image "name" to SQL and store the new image file in the directory, But I'm not able to find a good way to do it and my existing code is not working as well for the file upload.
.PHP file
<?PHP
$base_url = "https://example.com/"; // Current page path URL: https://example.com/settings#/edit-profile
$uniqueid = $_SESSION['uniqueid']; // Current user unique id.
// For Extension
function getExtension($str) {
$i = strrpos($str,".");
if (!$i) { return ""; }
$l = strlen($str) - $i;
$ext = substr($str,$i+1,$l);
return $ext;
}
?>
<?php
if(!empty($uniqueid))
{
$edituserid = $uniqueid;
$query_result=mysqli_query($con,"SELECT * FROM tbl_admin WHERE uniqueid='$edituserid'");
$numrows=mysqli_num_rows($query_result);
if(!$numrows)
{
$_SESSION['error'] = "Somthing went wrong!";
header('Location:'.$base_url.'settings#/edit-profile');
}
else
{
$Query = mysqli_query($con,"SELECT * FROM tbl_admin WHERE uniqueid='$edituserid'");
$editRow = mysqli_fetch_array($Query);
$edituserid = $editRow['uniqueid'];
$previousimage = $editRow['profile_image'];
}
}
?>
<?php
if(isset($_POST['update_user_info']))
{
$first_name = mysqli_real_escape_string($con,$_POST['first_name']);
$last_name = mysqli_real_escape_string($con,$_POST['last_name']);
$uniqueid1 = mysqli_real_escape_string($con,$_POST['uniqueid']);
// Image preparation
$profile_image = $_FILES['profile_image']['name'];
if($profile_image)
{
$profile_image_original = ($_FILES['profile_image']['name']);
$profile_image = ($uniqueid);
$profile_image_extension = getExtension($profile_image_original);
$extension = strtolower($profile_image_extension);
$dot = ".";
$profile_image_type = $_FILES['profile_image']['type'];
$profile_image_size = $_FILES['profile_image']['size'];
$image_file_name = "assets/user_images/".$profile_image.=$dot.=$extension;
move_uploaded_file($_FILES['profile_image']['tmp_name'], $image_file_name);
}
else
{
$profile_image = $previousimage;
}
if(!empty($_FILES['profile_image']['name']))
{
$sql2 = "UPDATE `tbl_admin` SET `first_name`='$first_name', `last_name`='$last_name', `uniqueid`='$uniqueid1', `profile_image`='$profile_image' WHERE uniqueid='$edituserid'";
}
else
{
$sql2 = "UPDATE `tbl_admin` SET `first_name`='$first_name', `last_name`='$last_name', `uniqueid`='$uniqueid1' WHERE uniqueid='$edituserid'";
}
//var_dump($sql); exit();
$result2 = mysqli_query($con, $sql2);
if($result2)
{
$_SESSION['success'] = "Update successful!";
header('Location:'.$base_url.'settings#/edit-profile');
} else {
$error="Something went wrong !";
}
$first_name = '';
$last_name = '';
$uniqueid1 = '';
}
?>
HTML form
<form method="POST" enctype="multipart/form-data">
<div class="row">
<div class="col-md-4 col-sm-12">
<div class="container">
<div class="avatar-upload">
<div class="avatar-edit">
<input type="file" id="imageUpload" name="profile_image" accept="image/*" />
<label for="imageUpload"></label>
</div>
<div class="avatar-preview">
</div>
</div>
</div>
</div>
<div class="form-group row">
<label for="staticEmail" class="col-sm-4 col-form-label">Email</label>
<div class="col-sm-8">
<input type="text" readonly class="form-control" id="staticEmail" value="<?php if(!empty($editRow)){ echo $editRow['email']; } ?>">
</div>
</div>
<div class="form-group row">
<label for="inputFirstName" class="col-sm-4 col-form-label">First Name</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="inputFirstName" name="first_name" value="<?php if(!empty($editRow)){ echo $editRow['first_name']; } ?>">
</div>
</div>
<div class="form-group row">
<label for="inputLastName" class="col-sm-4 col-form-label">Last Name</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="inputLastName" name="last_name" value="<?php if(!empty($editRow)){ echo $editRow['last_name']; } ?>">
</div>
</div>
<div class="form-group row">
<label for="inputSxID" class="col-sm-4 col-form-label">ID</label>
<div class="col-sm-8">
<input type="text" readonly class="form-control" id="inputSxID" name="uniqueid" value="<?php if(!empty($editRow)){ echo $editRow['uniqueid']; } ?>">
</div>
</div>
<button type="submit" class="btn btn-primary" name="update_user_info">Update</button>
</div>
</div>
</form>
It handles This table
id
first_name
last_name
email
profile_image
1
Joe
Dilon
abc#mail.com
abc.jpg
To // after success post update
id
first_name
last_name
email
profile_image
1
Changed
Changed
abc#mail.com
abc.jpg //No Response
And also there is no image file transfer into the targeted directory path. I'm not able to figure what's wrong or best way to do it correctly.

Move uploaded file in php work only sometimes when use multiple uploads

I have a web page for uploading tile image and a concept design image using that tile with a single submit button. But when uploading 2 images with a single submit, move uploaded file is not working always. Sometimes it just moves tile images only, not concept image.
Here is my code:
if(isset($_POST['upload']))
{
$name=$_POST['name'];
$size=$_POST['size'];
$finish=$_POST['finish'];
/* Concept Image */
$concept=$_FILES['concept']['name'];
$contmp=$_FILES['concept']['tmp_name'];
$location='concept';
$upload=move_uploaded_file($contmp,'concept/'.$concept);
$confile='concept/'.$concept;
/* Tile Image */
$image=$_FILES['image']['name'];
$imgtmp=$_FILES['image']['tmp_name'];
$location='tileimage';
$uploading=move_uploaded_file($imgtmp,"tileimage/".$image);
$upfile="tileimage/".$image;
$qry="insert into tile_list value('','$name','$size','$finish','$upfile','$confile')";
$ex=mysqli_query($con,$qry);
$query="insert into availcolors value('','$name','$name','$upfile','$confile')";
$exe=mysqli_query($con,$query);
}
and here is my html markup:
<form method="post" enctype="multipart/form-data" class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-4">TILE IMAGE<br>
</label>
<div class="col-sm-10 col-md-offset-0 col-md-4">
<input type="file" class="form-control" name=image>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">CONCEPT 3D<br>
</label>
<div class="col-sm-10 col-md-offset-0 col-md-4">
<input type="file" class="form-control" name="concept">
</div>
</div>
<div class="col-sm-10 col-md-7 col-md-offset-4">
<button type="submit" name="upload"><img src="images/upload.jpg" alt="" width="106" height="25" class="img-responsive"></button>
</div>
<form>
Please help me to find out what is the problem
Please try this code:
<?php
//error_reporting(0);
if(isset($_POST['upload']))
{
$name = $_POST['name'];
$size = $_POST['size'];
$finish = $_POST['finish'];
/* Concept Image */
$aMyUploads = array();
foreach ($_FILES as $key => $aFile) {
for($i = 0; $i<count($aFile['error']); $i++){
//echo $aFile['error'][$i]; exit;
if(0 === $aFile['error'][$i]){
if($i == 0)
$newLocation = 'concept/'.$aFile['name'][$i];
else if($i == 1)
$newLocation = 'tileimage/'.$aFile['name'][$i];
}
if(0 === $aFile['error'][$i] && (false !== move_uploaded_file($aFile['tmp_name'][$i], $newLocation))){
$aMyUploads[] = $newLocation;
} else {
$aMyUploads[] = '';
}
}
}
if(is_array($aMyUploads)){
$confile=$aMyUploads[0];
$upfile=$aMyUploads[1];
$qry="insert into tile_list value('','$name','$size','$finish','$upfile','$confile')";
$ex=mysqli_query($con,$qry);
$query="insert into availcolors value('','$name','$name','$upfile','$confile')";
$exe=mysqli_query($con,$query);
}else{
echo "ERROR :: Not insert Please try";
}
}
?>
<html>
<form method="post" enctype="multipart/form-data" class="form-horizontal" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<div class="form-group">
<label class="control-label col-sm-4">TILE IMAGE<br></label>
<div class="col-sm-10 col-md-offset-0 col-md-4">
<input type="file" class="form-control" name="upload_files[]">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">CONCEPT 3D<br></label>
<div class="col-sm-10 col-md-offset-0 col-md-4">
<input type="file" class="form-control" name="upload_files[]">
</div>
</div>
<div class="col-sm-10 col-md-7 col-md-offset-4">
<button type="submit" name="upload"><img src="images/upload.jpg" alt="" width="106" height="25" class="img-responsive"></button>
</div>
</form>
</html>

How to run 2 or more input files in the same form with PHP

I would like to know how to run 2 or more input files in the same form, I have to upload some documents by using php, I made separate forms and they work, but I need to all together however I dont know how. I need to put only two forms as example actually I need to put 3 but the 3rd is larger so it would be much code to read with an example putting only two I would be able to do the rest.
Note: Form 1 and Form to upload data to different tables.
Form 1
<div class="container">
<?php
if(isset($_POST['uploadBtn'])){
$fileName=$_FILES['myFile']['name'];
$fileTmpName=$_FILES['myFile']['tmp_name'];
$fileExtension=pathinfo($fileName,PATHINFO_EXTENSION);
$allowedType = array('csv');
if(!in_array($fileExtension,$allowedType)){?>
<div class="alert alert-danger">
INVALID FILE
</div>
<?php }else{
$handle = fopen($fileTmpName, 'r');
$k = 0;
$energies = array ();
while (($myData = fgetcsv($handle,1000,',')) !== FALSE) {
$k++;
if ( $k > 1 ) {
$energies[] = $myData[3];
}
}
list($e1, $e2, $e3) = $energies;
$query = "INSERT INTO metlab.resultados_impacto_junta (energy1, energy2, energy3) VALUES ($e1, $e2, $e3)";
$run = mysql_query($query);
if(!$run){
die("error in uploading file".mysql_error());
}else{ ?>
<div class="alert alert-success">
SUCCESS
</div>
<?php }
}
}
?>
<form action="" method="post" enctype="multipart/form-data">
<h3 class="text-center">
RESULTS
</h3></hr>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<input type="file" name="myFile" class="form-control">
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<input type="submit" name ="uploadBtn" class="btn btn-info">
</div>
</div>
</div>
</form>
Form 2
<div class="container">
<?php
if(isset($_POST['uploadBtn'])){
$fileName=$_FILES['myFile']['name'];
$fileTmpName=$_FILES['myFile']['tmp_name'];
//RUTA DEL ARCHIVO
$fileExtension=pathinfo($fileName,PATHINFO_EXTENSION);
//FORMATOS DE ARCHIVO PERMITIDOS
$allowedType = array('csv');
if(!in_array($fileExtension,$allowedType)){?>
<div class="alert alert-danger">
INVALID FILE
</div>
<?php }else{
$handle = fopen($fileTmpName, 'r');
$k = 0;
while (($myData = fgetcsv($handle,1000,','))!== FALSE){
$k++;
if ( $k > 4 ) {
$valor_dureza = $myData[3];
$query = "INSERT INTO metlab.resultados_tension_junta (size,yield,tensile,ra,elongacion)
VALUES ('".$valor_dureza."')";
$run = mysql_query($query);
}
}
if(!$run){
die("error in uploading file".mysql_error());
}else{ ?>
<div class="alert alert-success">
SUCCESS
</div>
<?php }
}
}
?>
<form action="" method="post" enctype="multipart/form-data">
<h3 class="text-center">
RESULTS
</h3></hr>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<input type="file" name="myFile" class="form-control">
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<input type="submit" name ="uploadBtn" class="btn btn-info">
</div>
</div>
</div>
</form>
I would like a form like this:
With the Fk I would know which number the 3 docs belong to.
I solved the problem myself I just changed the vars of the forms and thats all, Its a dirty and bad solution but it works for now.

Update query is not working in Mysql but instead inserting new data in this query

Table name = image_2017.My image is not updating by this UPDATE query in a particular $_GET['id'] instead image is inserting as a new image. I don't know what is wrong in this code.I am new to php. Kindly help me someone.
<?php
include_once "config.php";
session_start();
if(!isset($_SESSION)){
header("index.php");
}
$id = $_GET['id'];
//echo $id;
if(!empty($_FILES)){
$t = time();
$filename = $category."_".$t."_".$_FILES['image']['name'];
$upload = "uploads/";
$fileupload = move_uploaded_file($_FILES['image']['tmp_name'],$upload.$filename);
if($fileupload){
$msg1 = "File uploaded Successfully";
}else{
$msg2 = "File uploaded Failed";
}
}
if(!empty($_POST)){
$category = $_POST['category'];
$image = $_FILES['image'];
$query = "UPDATE image_2017 SET category ='$category', image ='$filename' WHERE id ='$id' ";
$result = $db->query($query);
if($result){
$msg3 = "Image Updated Successfully";
}else{
$msg4 = "Image not Updated";
}
}else{
//echo "Please enter all the details";
}
?>
<html>
<body>
<form class="form news" style="padding:10px;" method="post" action="image-2017.php" enctype="multipart/form-data">
<div class="row">
<div class="form-group">
<label class="control-label col-md-2">category</label>
<div class="col-md-4">
<select class="form-control" name="category">
<option>--> Select <--</option>
<option>Birthday</option>
<option>Christmas</option>
<option>Fruits</option>
<option>Ganesh Chathurthi</option>
<option>Green Day</option>
<option>Guitar Play</option>
<option>Independence Day</option>
<option>Krishna Jayanthi</option>
<option>Onam</option>
<option>Splash Pool</option>
<option>Teddy Bear</option>
<option>Veg Market</option>
<option>Vijayadhasami</option>
</select>
</div>
</div>
</div>
<br>
<div class="row">
<div class="form-group">
<label class="control-label col-md-2">Upload Image</label>
<div class="col-md-10">
<input type="file" name="image">
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-2"></label>
<div class="col-md-10">
<button type="submit" class="btn btn-primary">Submit</button>
<button type="button" class="btn btn-primary">Back</button>
</div>
</div>
</form>
</body>
</html>
I updated html to add a post for id
<?php
include_once "config.php";
session_start();
if(!isset($_SESSION)){
header("index.php");
}
$id = $_POST['id'];
//echo $id;
if(!empty($_FILES)){
$t = time();
$filename = $category."_".$t."_".$_FILES['image']['name'];
$upload = "uploads/";
$fileupload = move_uploaded_file($_FILES['image']['tmp_name'],$upload.$filename);
if($fileupload){
$msg1 = "File uploaded Successfully";
}else{
$msg2 = "File uploaded Failed";
}
}
if(!empty($_POST)){
$category = $_POST['category'];
$image = $_FILES['image'];
$query = "UPDATE image_2017 SET category ='$category', image ='$filename' WHERE id ='$id' ";
$result = $db->query($query);
if($result){
$msg3 = "Image Updated Successfully";
}else{
$msg4 = "Image not Updated";
}
}else{
//echo "Please enter all the details";
}
?>
<html>
<body>
<form class="form news" style="padding:10px;" method="post" action="image-2017.php" enctype="multipart/form-data">
<div class="row">
<div class="form-group">
<label class="control-label col-md-2">category</label>
<div class="col-md-4">
<select class="form-control" name="category">
<option>--> Select <--</option>
<option>Birthday</option>
<option>Christmas</option>
<option>Fruits</option>
<option>Ganesh Chathurthi</option>
<option>Green Day</option>
<option>Guitar Play</option>
<option>Independence Day</option>
<option>Krishna Jayanthi</option>
<option>Onam</option>
<option>Splash Pool</option>
<option>Teddy Bear</option>
<option>Veg Market</option>
<option>Vijayadhasami</option>
</select>
</div>
</div>
</div>
<br>
<div class="row">
<div class="form-group">
<label class="control-label col-md-2">Upload Image</label>
<div class="col-md-10">
<input type="file" name="image">
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-2"></label>
<div class="col-md-10">
<input type="hidden" name="id" value="<?php echo $_GET['id'];?>">
<button type="submit" class="btn btn-primary">Submit</button>
<button type="button" class="btn btn-primary">Back</button>
</div>
</div>
</form>
</body>
</html>
Make sure you reach the page as: mypage.php?id=12

I seek to both upload a file and update my MySQL database in a PHP script that handles an AJAX request

I have been working on this for hours and can't get it. In short, I want to be able to work with both $_FILES and $_POST in my PHP file that handles an AJAX request made through WordPress's API, because this is a file upload procedure that also needs to keep references to the file in the database. Every example I've seen on the internet either shows how to upload a file or use non-file inputs, but never both.
My PHP script which attempts to do both is
add_action( 'wp_ajax_member_update', 'member_update' );
function member_update ( )
{
// there must be a more elegant way of getting those values out ....
$name = $_POST['postData'][0]['value'];
$title = $_POST['postData'][1]['value'];
$bio = $_POST['postData'][2]['value'];
$sord = $_POST['postData'][3]['value'];
$id = $_POST['postData'][4]['value'];
$targetFileName = basename($_FILES['pic']['name']); // DOESN'T WORK! $_FILES is empty
$targetFileNameAndPath = 'assets/' . $targetFileName;
$message = "";
$thisAction = $_POST['postData'][5]['value'];
switch ($thisAction)
{
case 'add':
{
global $wpdb;
$q = "INSERT INTO " . MySqlInfo::TEAMTABLENAME . " (name, title, bio, sord, picfn) VALUES (" . implode( ',', array("'$name'", "'$title'", "'$bio'", intval($sord), "'somepic.jpg'")) . ")";
if($wpdb->query($q))
{
if (move_uploaded_file($_FILES['pic']['tmp_name'], $targetFileNameAndPath))
{
$message .= "Successfully added " . $targetFileName . " to assets folder\n";
}
else
{
$message .= "Encountered problem when trying to add " . $targetFileName . " to assets folder\n";
// now delete member ...
}
}
else
{
$message .= 'Error when trying to run query ' . $wpdb->last_query;
}
break;
}
case 'update':
{
// ...
break;
}
case 'delete':
{
global $wpdb;
$qresult = $wpdb->get_results('SELECT picfn FROM ' . MySqlInfo::TEAMTABLENAME . ' WHERE id=' . $id);
if ($qresult) // if was able to retrieve pic file name from db
{
echo "qresult[0] = " . json_encode($qresult[0]);
// try to delete profile picture from assets folder
if (unlink(get_template_directory() . '/management/assets/' . $qresult[0]->picfn))
{
// try to delete db info about member
if ($wpdb->query("DELETE FROM " . MySqlInfo::TEAMTABLENAME . " WHERE id=" . $id))
{
$message .= "Member successfully deleted!";
}
else
{
$message .= "Deleted profile image, but couldn't delete member from database, for some reason";
}
}
else
{
$message .= 'Could not delete profile picture from assets folder, for some reason';
}
}
else // was not able to retrive pic file name from db
{
$message .= "Couldn't select profile picture file name with query " . $wpdb->last_query . ", for some reason.";
}
break;
}
default:
{
$message .= 'Didn\'t recognize action.';
break;
}
}
echo json_encode($message);
wp_die();
}
and I'm running into the problem of $_FILES not containing anything. My JavaScript that submits the request is
jQuery('.member-update-button').click( function() {
// change the value of the memberAction hidden input based on which member-update-button was clicked
var memActionInput = jQuery('input[name="memberAction"');
switch (jQuery(this).attr('id'))
{
case 'remv-btn':
memActionInput.val('delete');
break;
case 'update-btn':
memActionInput.val('update');
break;
case 'add-btn':
memActionInput.val('add');
break;
}
// Serialize form and post using WP hook method
var parentForm = jQuery(this).closest('form');
var postData = parentForm.serializeArray();
jQuery.post( ajaxurl,
{'action': 'member_update', 'postData' : postData},
function(response)
{
jQuery('#member-modal').modal('hide');
alert(response);
}
);
});
and the HTML for the form is
<form method="POST" action="member-update" enctype="multipart/form-data" id="member-form">
<div class="modal fade" id="member-modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<h2></h2>
</div>
</div>
</div>
<div class="modal-body">
<div class="row">
<div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
Full name:
</div>
<div class="col-xs-12 col-sm-9 col-md-9 col-lg-9">
<input type="text" name="fullname" value="">
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
Title:
</div>
<div class="col-xs-12 col-sm-9 col-md-9 col-lg-9">
<input type="text" name="title" value="">
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
Bio (approx 150 chars):
</div>
<div class="col-xs-12 col-sm-9 col-md-9 col-lg-9">
<textarea rows="4" name="bio" form="member-form"></textarea>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
Sort order:
</div>
<div class="col-xs-12 col-sm-9 col-md-9 col-lg-9">
<input type="text" name="sord" value="">
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
Pic:
</div>
<div class="col-xs-12 col-sm-9 col-md-9 col-lg-9">
<input type="file" name="pic" id="pic-input">
</div>
</div>
</div>
<div class="modal-footer">
<div class="row">
<div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
<!-- empty space -->
</div>
<div class="col-xs-12 col-sm-9 col-md-9 col-lg-9">
<button type="button" class="member-update-button wp-core-ui button-primary" id="remv-btn">Remove</button>
<button type="button" class="member-update-button wp-core-ui button-primary" id="update-btn">Update</button>
<button type="button" class="member-update-button wp-core-ui button-primary" id="add-btn">Add</button>
</div>
</div>
</div>
<input type="hidden" name="memberId" value="" />
<input type="hidden" name="memberAction" value="" />
</div>
</div>
</div>
</form>

Categories