Radio button is not showing in page - php

For laravel project i use a metarial design bootstrap(MDBootstrap) template. use this template for master design and if i need to add somthing then i use #yeild(''). every thing is fine but if want to add radio button in form, this button is not showing in page.
here is my head what master.blade.php used..
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'Laravel') }}</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css">
<!-- Scripts -->
<!-- Fonts -->
<link rel="dns-prefetch" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Raleway:300,400,600" rel="stylesheet" type="text/css">
<!-- Styles -->
<link href="metarial/css/mdb.min.css" rel="stylesheet">
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<link href="metarial/bootstrap.min.css" rel="stylesheet">
at last of the body...
<script type="text/javascript" src="metarial/js/jquery-3.2.1.min.js"></script>
<!-- Tooltips -->
<script type="text/javascript" src="metarial/js/popper.min.js"></script>
<!-- Bootstrap core JavaScript -->
{{--
<script type="text/javascript" src="metarial/js/bootstrap.min.js"></script> --}}
<script src="{{ asset('js/app.js') }}" defer></script>
<!-- MDB core JavaScript -->
<script type="text/javascript" src="metarial/js/mdb.min.js"></script>
<script>
// SideNav Initialization
$(".button-collapse").sideNav();
new WOW().init();
</script>
Form is...
<form role="form" action="{{url('/children/add')}}" method="post" enctype="multipart/form-data">
#csrf
<div class="form-group ml-4 mr-4">
<div class="row">
<div class="col-6">
<label for="name">First Name</label>
<input value="{{ old('firstName') }}" name="firstName" type="text" class="form-control" id="first" placeholder="First Name">
</div>
<div class="col-6">
<label for="name">Last Name</label>
<input value="{{ old('lastName') }}" name="lastName" type="text" class="form-control" id="last" placeholder="Last Name">
</div>
</div>
</div>
<div class="radio form-group ml-4 mr-4">
<label><input type="radio" name="optradio">Male</label>
</div>
<div class="radio">
<label><input type="radio" name="optradio">Female</label>
</div>
<div class="form-group ml-4 mr-4">
<label for="Birthday">Birthday</label>
<input name="birthday" type="date" class="form-control" id="birthday">
</div>
<div class="form-group ml-4 mr-4">
<label for="image">Profile Image</label>
<input type="file" name="image" class="form-control" id="image">
</div>
<button type="submit" style="background-color:#2DAE60;" class="btn">
<i class="fa fa-plus"></i> ADD </button>
</form>
picture of this page where radio button missing but text 'Male','Female' is remaining...
can anyone help me please?

Try changing this:
<div class="radio">
<label><input type="radio" name="optradio">Female</label>
</div>
To this:
<div class="radio">
<input type="radio" id="female-rb" name="optradio" />
<label for="female-rb">Female</label>
</div>
When using labels you should define for which radio button the label applies. You do this by adding the for attribute and let it referring the id of the radio button. To correctly render the radio button you should place the input first and then the label.

Related

multi page form laravel

Hello I am creating a multi form page but when data is insetting in database it insert on 2 row with different ids I need each submit be as one id not 2 ids kindly check the code below note that I am new should I add the session or what is the best way to do it .thank you
Controller
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class secmultiController extends Controller
{
public function NameMentionded(){
return view('multiform.name');
}
public function AddNameMentionded(Request $request){
$request->validate([
'empname'=> 'required ',
'empnum'=> 'required ',
]);
$query = DB::table('secmultis')->insert([
'empname'=>$request->input('empname'),
'empnum'=>$request->input('empnum'),
]);
return redirect('reports');
}
public function ReportPerson(){
return view('multiform.as');
}
public function adds(Request $request){
$request->validate([
'incnam'=> 'required ',
'incnum' => 'required ',
'inctdes' => 'required ',
'inctype' => 'required ',
'inncity' => 'required ',
'incday' => 'required ',
'incatt' => 'required ',
'incterm' => 'required ',
]);
$query = DB::table('secmultis')->insert([
'incnam'=>$request->input('incnam'),
'incnum'=>$request->input('incnum'),
'inctdes'=>$request->input('inctdes'),
'inctype'=>$request->input('inctype'),
'incterm'=>$request->input('incterm'),
'inncity'=>$request->input('inncity'),
'incday'=>$request->input('incday'),
'incatt'=>$request->input('incatt'),
]);
if($query){
return back()->with('success','Data have been successfully inserted');
}else{
return back()->with('fail','Data have not been successfully inserted');
}
}
}
Route
<?php
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\MultiformController;
use App\Http\Controllers\secmultiController;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', function () {
return view('test');
});
/// multipage form
Route::controller(secmultiController::class)->group(function(){
Route::get('/name','NameMentionded')->name('name.mentioned');
Route::post('/add','AddNameMentionded')->name('addname.mentioned');
Route::get('/reports','ReportPerson');
Route::POST('/adds','adds');
});
Route::get('/dashboard', function () {
return view('admin.index');
})->middleware(['auth','verified'])->name('dashboard');
require __DIR__.'/auth.php';
nano.blade
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Dashboard | Makassed Speak </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta content="Premium Multipurpose Admin & Dashboard Template" name="description" />
<meta content="Themesdesign" name="author" />
<!-- App favicon -->
<link rel="shortcut icon" href="{{ asset('backend/assets/images/favicon.ico') }}">
<!-- jquery.vectormap css -->
<link href="{{ asset('backend/assets/libs/admin-resources/jquery.vectormap/jquery-jvectormap-1.2.2.css') }}" rel="stylesheet" type="text/css" />
<!-- DataTables -->
<link href="{{ asset('backend/assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css') }}" rel="stylesheet" type="text/css" />
<!-- Responsive datatable examples -->
<link href="{{ asset('backend/assets/libs/datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css') }}" rel="stylesheet" type="text/css" />
<!-- Bootstrap Css -->
<link href="{{ asset('backend/assets/css/bootstrap.min.css') }}" id="bootstrap-style" rel="stylesheet" type="text/css" />
<!-- Icons Css -->
<link href="{{ asset('backend/assets/css/icons.min.css') }}" rel="stylesheet" type="text/css" />
<!-- App Css-->
<link href="{{ asset('backend/assets/css/app.min.css') }}" id="app-style" rel="stylesheet" type="text/css" />
<!-- App bootstrap-->
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/bootstrap.tagsinput/0.8.0/bootstrap-tagsinput.css" >
<!-- App toastr-->
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.css" >
<!-- App datepicker-->
<link href="{{asset('backend/assets/libs/bootstrap-datepicker/css/bootstrap-datepicker.min.css')}}" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row" style="margin-top:50px;";>
<br>
</div>
</div>
<form action="add" method="POST" novalidate="">
#csrf
<div class="container">
<div class="col-md-6 offset-md-3">
<div class="card">
<div class="card-header bg-secondary text-white">nona </div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label class="form-label">Employee Name </label>
<input type="text" class="form-control" name="empname" placeholder="" required="">
<span style="color:red;">#error('empname') {{$message}} #enderror</span>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label class="form-label"> Employee #</label>
<input type="text" class="form-control" name="empnum" placeholder="" required="">
<span style="color:red;">#error('empnum') {{$message}} #enderror</span>
</div>
</div>
</div>
<button class="btn btn-primary" type="submit">Next</button>
</div>
</form>
<script src="{{asset('backend/assets/libs/jquery/jquery.min.js')}}"></script>
<script src="{{asset('backend/assets/libs/bootstrap/js/bootstrap.bundle.min.js')}}"></script>
<script src="{{asset('backend/assets/libs/metismenu/metisMenu.min.js')}}"></script>
<script src="{{asset('backend/assets/libs/simplebar/simplebar.min.js')}}"></script>
<script src="{{asset('backend/assets/libs/node-waves/waves.min.js')}}"></script>
<script src="{{asset('backend/assets/libs/parsleyjs/parsley.min.js')}}"></script>
<script src="{{asset('backend/assets/js/pages/form-validation.init.js')}}"></script>
<script src="{{asset('backend/assets/js/app.js')}}"></script>
<script src="{{asset('backend/assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.min.js')}}"></script>
</body>
</html>
as.blade
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Dashboard | Makassed Speak </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta content="Premium Multipurpose Admin & Dashboard Template" name="description" />
<meta content="Themesdesign" name="author" />
<!-- App favicon -->
<link rel="shortcut icon" href="{{ asset('backend/assets/images/favicon.ico') }}">
<!-- jquery.vectormap css -->
<link href="{{ asset('backend/assets/libs/admin-resources/jquery.vectormap/jquery-jvectormap-1.2.2.css') }}" rel="stylesheet" type="text/css" />
<!-- DataTables -->
<link href="{{ asset('backend/assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css') }}" rel="stylesheet" type="text/css" />
<!-- Responsive datatable examples -->
<link href="{{ asset('backend/assets/libs/datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css') }}" rel="stylesheet" type="text/css" />
<!-- Bootstrap Css -->
<link href="{{ asset('backend/assets/css/bootstrap.min.css') }}" id="bootstrap-style" rel="stylesheet" type="text/css" />
<!-- Icons Css -->
<link href="{{ asset('backend/assets/css/icons.min.css') }}" rel="stylesheet" type="text/css" />
<!-- App Css-->
<link href="{{ asset('backend/assets/css/app.min.css') }}" id="app-style" rel="stylesheet" type="text/css" />
<!-- App bootstrap-->
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/bootstrap.tagsinput/0.8.0/bootstrap-tagsinput.css" >
<!-- App toastr-->
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.css" >
<!-- App datepicker-->
<link href="{{asset('backend/assets/libs/bootstrap-datepicker/css/bootstrap-datepicker.min.css')}}" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row" style="margin-top:50px;";>
<br>
</div>
</div>
s
<form action="adds" method="POST" novalidate="">
#csrf
<div class="container">
<div class="col-md-6 offset-md-3">
<div class="card">
<div class="card-header bg-secondary text-white">Emlpoyee </div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label class="form-label">Employee Name </label>
<input type="text" class="form-control" name="incnam" placeholder="" required="">
<span style="color:red;">#error('incnam') {{$message}} #enderror</span>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label class="form-label"> Employee #</label>
<input type="text" class="form-control" name="incnum" placeholder="" required="">
<span style="color:red;">#error('incnum') {{$message}} #enderror</span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="mb-3">
<label class="form-label">INCIDENT DETAILS</label>
<textarea class="form-control" name="inctdes" id="" cols="30" rows="10"></textarea>
<span style="color:red;">#error('inctdes') {{$message}} #enderror</span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="mb-3">
<label for="" class="form-label">INCIDENT TYPE</label>
<select class="form-select" name="inctype" id="" required="">
<option selected="" disabled="" value="">Choose...</option>
<option>THEFT</option>
<option>NON COMPLIANCE WITH COMPANY POLICY</option>
<option>ABUSING POWER</option>
<option>USING COMPANY PROPERTY FOR PERSONAL INTEREST</option>
<option>NEGLIGENCE</option>
</select>
<span style="color:red;">#error('inctype') {{$message}} #enderror</span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="mb-3">
<label for="" class="form-label">INCIDENT TYPE</label>
<select class="form-select" name="inncity" id="" required="">
<option selected="" disabled="" value="">Choose...</option>
<option>Beirut</option>
<option>North</option>
<option>South</option>
</select>
<span style="color:red;">#error('inncity') {{$message}} #enderror</span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="mb-4">
<label class="form-label">INCIDENT DATE
</label>
<div class="input-group" id="datepicker2">
<input type="text" name="incday" class="form-control" placeholder="dd M, yyyy" data-date-format="dd M, yyyy" data-date-container="#datepicker2" data-provide="datepicker" data-date-autoclose="true">
<span class="input-group-text"><i class="mdi mdi-calendar"></i></span>
<span style="color:red;">#error('incday') {{$message}} #enderror</span>
</div><!-- input-group -->
</div>
</div>
<div class="col-md-6">
<div class="mb-6">
<label class="form-label">INCIDENT DATE
</label>
<div class="input-group">
<input type="file" class="form-control" name="incatt" id="customFile">
<span style="color:red;">#error('incatt') {{$message}} #enderror</span>
</div>
</div>
</div>
/div>
<div class="row">
<div class="col-md-12">
<div class="mb-3">
<div class="d-flex flex-wrap gap-2">
<h6>I confirm that, all above provided information is correct.
</h6>
<input type="checkbox" name="incterm" id="switch3" switch="bool" checked="">
<label for="switch3" data-on-label="Yes" data-off-label="No"></label>
<span style="color:red;">#error('incterm') {{$message}} #enderror</span>
</div>
</div>
</div>
</div>
<button class="btn btn-primary" type="submit">Next</button>
</div>
</form>
<script src="{{asset('backend/assets/libs/jquery/jquery.min.js')}}"></script>
<script src="{{asset('backend/assets/libs/bootstrap/js/bootstrap.bundle.min.js')}}"></script>
<script src="{{asset('backend/assets/libs/metismenu/metisMenu.min.js')}}"></script>
<script src="{{asset('backend/assets/libs/simplebar/simplebar.min.js')}}"></script>
<script src="{{asset('backend/assets/libs/node-waves/waves.min.js')}}"></script>
<script src="{{asset('backend/assets/libs/parsleyjs/parsley.min.js')}}"></script>
<script src="{{asset('backend/assets/js/pages/form-validation.init.js')}}"></script>
<script src="{{asset('backend/assets/js/app.js')}}"></script>
<script src="{{asset('backend/assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.min.js')}}"></script>
</body>
</html>

Submit button isn't sending everything | Bootstrap [duplicate]

This question already has answers here:
Form not showing input data
(2 answers)
Closed 2 years ago.
My submit button isn't sending all the form data.
I have an index.php with a bootstrap form and a create.php which does an echo on my form when it is submitted.
Problem I'm encoutering is is that none of the fields with user input are actually getting sent to my create.php, only the default Radio is getting sent
<?php
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="css/style.css">
<title></title>
</head>
<body>
<div id="form">
<form action="./create.php" method="post">
<img src="https://i.imgur.com/jDiqUAy.jpg" width="20%" heigth="20%">
<div class="form-group">
<label for="nameInput">Naam van uw kat</label>
<input type="text" class="form-control" id="nameInput" placeholder="Henkie">
</div>
<div class="form-group">
<label for="emailInput">Email address</label>
<input type="email" class="form-control" id="emailInput" placeholder="name#example.com">
</div>
<div class="form-group">
<label for="inputPassword">Wachtwoord</label>
<input type="password" class="form-control" id="inputPassword" placeholder="Bananen123">
</div>
<div class="form-group">
<label for="selectOptions">Kleur van uw kat</label>
<select class="form-control" id="selectOptions">
<option>Zwart</option>
<option>Wit</option>
<option>Oranje</option>
<option>Zwart met wit</option>
<option>Grijs</option>
</select>
</div>
<div class="form-check">
<p>Extras</p>
<input class="form-check-input" type="radio" name="hairRadio" id="hairRadio1" value="long" checked>
<label class="form-check-label" for="hairRadio1">
Lang
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="hairRadio" id="hairRadio2" value="short" checked>
<label class="form-check-label" for="hairRadio2">
Kort
</label>
</div>
<div class="form-check">
<input class="form-check-input position-static" type="checkbox" id="litterCheckbox" value="">
<label class="form-check-label" for="litterCheckbox">
Kattenbak
</label>
</div>
<div class="form-group row">
<div class="col-sm-10">
<button type="submit" class="btn btn-primary">Verstuur</button>
</div>
</div>
</form>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin="anonymous"></script>
</body>
</html>
create.php
<?php
echo var_dump($_POST);
It's because you didn't define name attribute for other inputs! Each input need name attribute so that it's data can be send with form.
For an input to be sent name attribute is required.
name attribute for your input is missing. Add that and it should solve the problem

how to redirect with php?

I want my code once press submit to be redirected to another website.
I want this to be done through a PHP script so it can be expanded.
The problem is that when I test the code the PHP script is loaded in the browser with a blank page instead of redirecting it to the web I want.
I leave you my current code:
SIGN_IN.HTML
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="https://getbootstrap.com/docs/4.0/assets/img/favicons/favicon.ico">
<title>Signin Template for Bootstrap</title>
<link rel="canonical" href="https://getbootstrap.com/docs/4.0/examples/sign-in/">
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/signin.css" rel="stylesheet">
</head>
<body class="text-center">
<div class="form-signin">
<form action="post.php">
<img class="mb-4" src="https://getbootstrap.com/docs/4.0/assets/brand/bootstrap-solid.svg" alt="" width="72" height="72">
<h1 class="h3 mb-3 font-weight-normal">Please sign in</h1>
<label for="inputEmail" class="sr-only">Email address</label>
<input type="email" id="inputEmail" class="form-control" placeholder="Email address" required autofocus>
<label for="inputPassword" class="sr-only">Password</label>
<input type="password" id="inputPassword" class="form-control" placeholder="Password" required>
<div class="checkbox mb-3">
<label>
<input type="checkbox" value="remember-me"> Remember me
</label>
</div>
<input class="btn btn-lg btn-primary btn-block" type="submit" value="Sign in"/>
<p class="mt-5 mb-3 text-muted">© 2017-2018</p>
</form>
</div>
</body>
</html>
POST.PHP
<?php
header ("Location: https://getbootstrap.com/docs/4.0/examples/sign-in/");exit;
?>
PD:As you can see, the page is an example website, I do not intend to carry out any cybercrime, just learn
Thanks
I think your file is Capital letter, right? It should be post.php, not POST.php.
Please check again.
I've tested your code with post.php. It works well.

CSS not getting applied even though console shows no error

I am designing page in CI framework and have correctly included files but the css is not getting applied even though browser shows its calling them correctly..not sure where I am going wrong.
Below is the code I have written:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
<title>login</title>
<?php include_once 'header.php'; ?>
</head>
<body class="bg-dark">
<div class="container">
<div class="card card-login mx-auto mt-5">
<div class="card-header">Please enter your login details:</div>
<div class="card-body">
<form>
<div class="form-group">
<label for="name">Username</label>
<input class="form-control" placeholder="User name" name="name" type="text" id="name" autofocus>
</div>
<div class="form-group">
<label for="password">Password</label>
<input class="form-control" id="password" type="password" placeholder="Password" id="password">
</div>
<div>
<input type="submit" name="submit" value="Login" class="btn btn-lg btn-success btn-block">
</div>
</form>
</div>
</div>
</div>
<!-- Bootstrap core JavaScript-->
<script src="<?php echo base_url('assets/vendor/jquery/jquery.min.js');?>"></script>
<script src="<?php echo base_url('assets/vendor/bootstrap/js/bootstrap.bundle.min.js');?>"></script>
<!-- Core plugin JavaScript-->
<script src="<?php echo base_url('assets/vendor/jquery-easing/jquery.easing.min.js');?>"></script>
</body>
</html>
When I click on browser by pressing F12 I get this :
<!DOCTYPE html>
<html lang="en">
<head>
<title>login</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<!-- Bootstrap core CSS-->
<link href="http://localhost/polyropes_new/assets/vendor/bootstrap/css/bootstrap.min.css">
<!-- Custom fonts for this template-->
<link href="http://localhost/polyropes_new/assets/vendor/font-awesome/css/font-awesome.min.css">
<!-- Page level plugin CSS-->
<link href="http://localhost/polyropes_new/assets/vendor/datatables/dataTables.bootstrap4.css">
<!-- Custom styles for this template-->
<link href="http://localhost/polyropes_new/assets/css/sb-admin.css">
</head>
<body class="bg-dark">
<div class="container">
<div class="card card-login mx-auto mt-5">
<div class="card-header">Please enter your login details:</div>
<div class="card-body">
<form>
<div class="form-group">
<label for="name">Username</label>
<input class="form-control" placeholder="User name" name="name" type="text" id="name" autofocus>
</div>
<div class="form-group">
<label for="password">Password</label>
<input class="form-control" id="password" type="password" placeholder="Password" id="password">
</div>
<div>
<input type="submit" name="submit" value="Login" class="btn btn-lg btn-success btn-block">
</div>
</form>
</div>
</div>
</div>
<!-- Bootstrap core JavaScript-->
<script src="http://localhost/polyropes_new/assets/vendor/jquery/jquery.min.js"></script>
<script src="http://localhost/polyropes_new/assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Core plugin JavaScript-->
<script src="http://localhost/polyropes_new/assets/vendor/jquery-easing/jquery.easing.min.js"></script>
</body>
</html>
This shows all files and CSS have been called correctly as none of them is blank.Please guide me

form with in form in php

i want to use form with in a form.
i have the following code.
<?php session_start();
if(!isset($_SESSION['logged_in'])){
echo "Sorry! You need to log in to add Information. <a href='login.php'>Login</a>";
} else {
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>iWant | in case you want anything</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!--link rel="stylesheet/less" href="less/bootstrap.less" type="text/css" /-->
<!--link rel="stylesheet/less" href="less/responsive.less" type="text/css" /-->
<!--script src="js/less-1.3.3.min.js"></script-->
<!--append ‘#!watch’ to the browser URL, then refresh the page. -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-responsive.min.css" rel="stylesheet">
<link href="css/bootstrap-fileupload.min.css" rel="stylesheet">
<link href="css/bootstrap-fileupload.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link rel="stylesheet" href="style.css" />
<script src="jquery.min.js"></script>
<script src="upload.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<![endif]-->
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="img/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="img/favicon.png">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/scripts.js"></script>
<script type="text/javascript" src="js/bootstrap-fileupload.js"></script>
<script type="text/javascript" src="js/bootstrap-fileupload.min.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
</head>
<body>
<div class="container-fluid">
<div class="row-fluid">
<div class="span4">
<h3>
iWant | In Case U Want Anything
</h3>
</div>
<div class="span4">
<form class="form-search">
<input type="text" class="input-medium search-query"> <button type="submit" class="btn">Search</button>
</form>
</div>
<div class="span4">
Login Sign Up
</div>
</div>
<div class="row-fluid">
<div class="span12">
<div class="navbar navbar-inverse">
<div class="navbar-inner">
<div class="container-fluid">
<a data-target=".navbar-responsive-collapse" data-toggle="collapse" class="btn btn-navbar"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a> iWant
<div class="nav-collapse collapse navbar-responsive-collapse">
<ul class="nav">
<li>
Home
</li>
<li>
About iWant
</li>
<li>
Contact iWant
</li>
</ul>
<ul class="nav pull-right">
<li>
My iWant
</li>
<li class="divider-vertical">
</li>
<li class="dropdown">
<a data-toggle="dropdown" class="dropdown-toggle" href="#">Post Adds<strong class="caret"></strong></a>
<ul class="dropdown-menu">
<li>
Room
</li>
<li>
Hostel
</li>
<li>
Apartment
</li>
<li>
Land
</li>
<li>
House
</li>
<li>
Vehicles
</li>
<li>
Hotels
</li>
<li>
Mobile Phones
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="well">
<form id="Room Details" class="form-horizontal" method="get" action="roomKoDesc.php">
<?php echo "<input type='hidden' name='clientId' value='".$_SESSION['clientId']."'>"; ?>
<legend>Post Rooms</legend>
<div class="control-group">
<label class="control-label">Contact Number</label>
<div class="controls">
<div class="input-prepend">
<input type="text" class="input-xlarge" id="contact" name="contact" placeholder="Your Contact">
</div>
</div>
</div>
<div class="control-group">
<label class="control-label">Location of Rooms</label>
<div class="controls">
<div class="input-prepend">
<input type="text" class="input-xlarge" id="location" name="location" placeholder="rooms location">
</div>
</div>
</div>
<div class="control-group ">
<label class="control-label">Number of Rooms</label>
<div class="controls">
<div class="input-prepend">
<input type="text" class="input-xlarge" id="number" name="number" placeholder="no. of rooms">
</div>
</div>
</div>
<div class="control-group">
<label class="control-label">Price per Room</label>
<div class="controls">
<div class="input-prepend">
<input type="text" class="input-xlarge" id="price" name="price" placeholder="price per room">
</div>
</div>
</div>
<div class="control-group">
<label class="control-label">Sqare meter</label>
<div class="controls">
<div class="input-prepend">
<input type="text" class="input-xlarge" id="size" name="size" placeholder="Area of rooms">
</div>
</div>
</div>
<div id ="main">
<form method="post" enctype="multipart/form-data" action="upload.php">
<input type="file" name="images" id="images" multiple />
<button type="submit" id="btn">Upload Files!</button>
</form>
<div id="response"></div>
<ul id="image-list">
</ul>
</div>
<div class="control-group">
<label class="control-label">Description</label>
<div class="controls">
<div class="input-prepend">
<textarea rows="4" cols="50" input type="text" class="input-xlarge" id="description" name="description" placeholder="Description"></textarea>
</div>
</div>
</div>
<input type="submit" class="btn btn-success" value="Submit" />
</form>
</div>
</div>
</div>
</body>
</html>
<?php } ?>
my output looks like this Example
But the submit button doesnot direct to another page.
and the upload works
How can i make both the submit button work?
Is there any easy procress to use nested form.
<input type="file" name="images" id="images" multiple />
Use just this for the entire form, do not use 2 separate forms. Also when the form is submitted you could upload the file.
Enjal,
Why do you want to use multiple form in one page. you can do the same thing by using a single form. Just make use of Javascript to change form 'action' attribute. code for that would be,
<html>
<head>
<script type="text/javascript" language="javascript">
function changeaction(url)
{
document.frm.action=url;
document.frm.submit();
}
</script>
</head>
<body>
<form name="frm" action="" method="post">
<input type="submit" name="submit" value="submit1" onclick="return changeaction('upload.php');">
<input type="submit" name="submit" value="submit2" onclick="return changeaction('index.php');">
</form>
</body>
</html>

Categories