google re captcha not showing up - php

I have implemented google re captcha in a modal popup. I have also included the api ,i.e recaptcha/api.js to enable the recpatcha. But it is not showing up when I invoke the popup.
When I right click on the popup and inspect, the div tag which includes the google recaptcha is being seen in the elements section .
I have included the modal popup in my footer page which is called by every page in my website.
My code:
<script src="https://www.google.com/recaptcha/api.js"></script>
<!-- Request A Demo POPUP(Start) -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<?php echo form_open(base_url( 'employer-request-demo/request-demo/submit' ), array( 'id' => 'idfrmdemo', 'name' =>'frmdemo', 'method'=>'post'));?>
<!-- input type="text" name="<?php //echo $this->security->get_csrf_token_name();?>" value="<?php //echo $this->security->get_csrf_hash();?>"-->
<div class="modal-content">
<div class="modal-header" align="center">
<button type="button" id="frmdemo-close" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title"><strong>Request a Demo</strong></h4>
</div>
<div class="modal-body" id="idmodalcontent">
<div class="row">
<div class="form-group col-md-6">
<label for="txtfirstname">FIRST NAME</label>
<input name="txtfirstname" type="text" class="form-control required" placeholder="Please enter your first name" id="idfirstname" >
</div>
<div class="form-group col-md-6">
<label for="txtlastname">LAST NAME</label>
<input name="txtlastname" type="text" class="form-control required" placeholder="Please enter your last name" id="idlastname">
</div>
</div>
<div class="form-group">
<label for="Email">CORPORATE EMAIL</label>
<input type="email" name="txtemail" class="form-control" placeholder="Please enter your email id" id="idemail">
<div class="divstyle"></div>
</div>
<div class="form-group">
<label for="idcompany">COMPANY NAME</label>
<input type="text" name="txtcompany" placeholder="Please enter the name of your company" class="form-control" id="idcompany" >
</div>
<div class="form-group">
<label for="Phone">PHONE</label>
<input type="tel" name="txtphone" placeholder="Please enter your phone number" class="form-control" id="idphone">
</div>
<div class="form-group">
<label for="">MODE OF CONTACT</label>
<select name="selmode" id="idmode" class="form-control">
<option value="" disabled selected>Select mode of contact</option>
<option value="email">Email</option>
<option value="phone">Phone</option>
<option value="any">Any</option>
</select>
</div>
<div class="form-group">
<div class="g-recaptcha" data-sitekey="6LexRREUAAAAAELhZaiO5FxRbgnyWEwIxFTWeHhE"></div>
<input type="hidden" class="hiddenRecaptcha required" name="cphiddenRecaptcha" id="idcphiddenRecaptcha">
</div>
</div>
<div class="modal-footer">
<div id="btn-smb">
<input type="submit" id="idsubmit" name="submit" value="Submit" class="btn btn-warning" />
</div>
<div id="btn-close" style="display:none;">
<input type="button" name="close" value="Close" class="btn btn-warning" id="idclose"/>
</div>
</div>
</div>
<input type="hidden" name="context" id="frm_context" value="Request A Demo" />
<?php echo form_close();?>
</div>
</div>
<!-- Request A Demo POPUP(End) -->
I am getting the following error in the console:
XMLHttpRequest cannot load javascript:void(0);. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.

Related

How to attach an element to a form

I'm writing a dynamic form that appends available text-fields depending on value that was selected by the user. How do I make it work? For context, it's an edit button, so the text-field will be pre-filled with STRING from the database.
The functions of getting the data from the database works, and the modal also shows, but the problem is just that the select-form doesn't work.
I tried calling "#btn-edit-account" but it doesn't work.
Code for the modal edit-account
<div class="modal fade" id="edit-account-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Edit Account Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="tab-content" id="nav-tabContent">
<div class="tab-pane fade show active" id="nav-add" role="tabpanel" aria-labelledby="nav-home-tab">
<form id="form-edit-account">
<input type="hidden" name="_token" value="{{csrf_token()}}">
<div class="container my-2">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label>Role</label>
<select type="select" id="select-role" class="form-control edit_role select-role" name="role_id" required>
</select>
</div>
<div class="form-group student-number-container hidden">
<label>Student Number</label>
<input type="text" class="form-control" id="edit_student_number" name="student_number" required>
</div>
<div class="organization-container hidden">
</div>
<div class="form-row">
<div class="col-md-6">
<label>First name</label>
<input type="text" class="form-control" id="edit_first_name" name="first_name" required>
</div>
<input type="hidden" id="token" name="_token" value="{{csrf_token()}}">
<div class="col-md-6">
<label>Last Name</label>
<input type="text" class="form-control" id="edit_last_name" name="last_name" required>
</div>
</div>
<div class="form-group">
<label>Email</label>
<input type="email" class="form-control" id="edit_email" name="email">
</div>
<div class="form-row">
<label class="control-label">New Password <span class="required">*</span></label>
<input type="password" id="new_password" name="new_password" minlength="6" class="form-control password" required>
</div>
<div class="form-row">
<label class="control-label">Confirm New Password <span class="required">*</span></label>
<input type="password" id="confirm_password" name="confirm_password" minlength="6" class="form-control password" required>
</div>
<div class="form-group text-right mt-4">
<button type="button" class="btn btn-dark" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-success btn-confirm-edit-account">Update</button>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
Javascript for btn-edit-account
$(document).on('click', '.btn-edit-account', function() {
$('#edit-account-modal').modal('show');
var id = $(this).attr('data-id');
$.ajax({
url: "users/get-specific-user-info",
type: "POST",
data: {
id: id,
_token: "{{csrf_token()}}"
},
success: function(data) {
// $('#edit_role').val(data.role_id);
$('#edit_first_name').val(data.first_name);
$('#edit_last_name').val(data.last_name);
$('#edit_email').val(data.email);
console.log(data);
}
});
});
});
Javascript for select-role
$(document).on('change', '#select-role', function() {
var val = $(this).val();
if(val != 3){
$('.student-number-container').show();
}
else {
$('.student-number-container').hide();
}
if(val != 1){
$('.organization-container').html("");
}
else {
appendOrganization();
$('.organization-container').show();
}
});
function for appendOrganization
function appendOrganization() {
var html = "";
html += '<div class="form-group"> <label>Organization Name</label> <input type="text" class="form-control" name="organization_name" required> </div>';
html += '<div class="form-group"> <label>Organization Type</label> <select type="select" id="select-org-type" class="form-control" name="organization_type" required>'+
'<option value="" selected disabled>Select Organization Type</option>'+
'<option value="TYPE A">TYPE A</option>'+
'<option value="TYPE B">TYPE B</option>'+
'</select></div>';
html += '<div class="form-group"> <label>College</label> <select type="select" id="select-org-type" class="form-control" name="organization_college" required> <option value="" selected disabled>Select Organization Type</option> <option value="COLLEGE ONE">COLLEGE ONE</option> <option value="COLLEGE TWO">COLLEGE TWO</option> </select> </div>';
$('.organization-container').html(html);
}
The select in the modal should show the available choices in the given select, then will dynamically change the form depending on the selected choice.

in Bootstrap4- I need to submit Modal Form using php

I am building this website for a takeaway restaurant and the client requested 2 models one for career (receiving the resumes ) and the other for subscription to email updates.
How can I let the Form of the MODEL send the data to a Php page for GET_POST ?
The reason I am asking this is I need to record all the Model data to a database of the server not only send an email with the data.
First Model #join us
<div class="modal" id="JoinModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Subscribe for our updates</h5>
<button class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<form action="addmail.php" method="post">
<div class="form-group">
<label for="username">Name</label>
<input type="text" id="fname" placeholder="Name" class="form-control">
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" id="email" placeholder="Email" class="form-control">
</div>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-success" value="Submit">Join</button>
</div>
</div>
</div>
</div>
The other model for receiving the resumes
<!-- Career MODAL -->
<div class="modal" id="CareerModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Join our Team</h5>
<button class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label for="username">Name</label>
<input type="text" placeholder="Name" class="form-control">
</div>
<div class="form-group">
<label for="familyname">Family Name</label>
<input type="text" placeholder="Family Name" class="form-control">
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" placeholder="Email" class="form-control">
</div>
<div class="form-group">
<label for="cv">Attach your CV</label>
<input type='file' name='cv' id='cv' class='form-control' ><br>
<input type='button' class='btn btn-info' value='Upload' id='upload'>
</div>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-primary" value="Submit">Apply</button>
</div>
</div>
</div>
</div>
</div>
you can use ajax that will help you to perform parallel operation
e.g : inserting to database and sending mail
hope, it works for you

retrieve data from table and that data use to login

I want to create a login form to log system in php. But I can't do it, below I mentioned my code. I have coded registration form also. It works successfully, but the login form does not works properly. The registration form code is included in the index page. But the login code is include in login.php page.
Help me to solve this problem.
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×</button>
<h4 style="text-align: center" class="modal-title" id="myModalLabel">
Login & Registration</a></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-8" style="border-right: 1px dotted #C2C2C2;padding-right: 30px;">
<!-- Nav tabs -->
<ul class="nav nav-tabs">
<li class="active">Login</li>
<li>Registration</li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="Login">
<form class="form-horizontal" actoin="login.php" method="post" >
<div class="form-group">
<label class="col-sm-2 control-label">
Username</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="username2" id="username2" placeholder="Username" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">
Password</label>
<div class="col-sm-10">
<input type="password" class="form-control" name="pwd2" id="pwd2" placeholder="Password" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">
User Type</label>
<div class="col-sm-10">
<select class="form-control" name="utype" id="utype">
<option selected disabled>User Type</option>
<option value="Admin">Admin</option>
<option value="Student">Student</option>
<option value="Company">Company</option>
</select>
</div>
</div>
<div class="row">
<div class="col-sm-2">
</div>
<div class="col-sm-10">
<input type="submit" class="btn btn-primary btn-sm" name="buttonsubmit" id="buttonsubmit" value="Login">
Forgot your password?
</div>
</div>
</form>
</div>
<div class="tab-pane" id="Registration">
<form class="form-horizontal" action="index.php" method="post">
<div class="form-group">
<label class="col-sm-2 control-label">
Title</label>
<div class="col-sm-10">
<div class="row">
<div class="col-md-3">
<select class="form-control" id="uutypex" name="uutype">
<option>Mr.</option>
<option>Ms.</option>
<option>Mrs.</option>
</select>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">
Name</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="name" id="name" placeholder="Name" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">
User Name</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="username1" id="username1" placeholder="User Name" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">
Password</label>
<div class="col-sm-10">
<input class="form-control" name="pwd" id="pwd" type="password" placeholder="Password" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">
Birth Date
</label>
<div class="col-sm-10">
<input class="form-control" name="bdate" id="bdate" type="date">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">
Email</label>
<div class="col-sm-10">
<input type="email" class="form-control" name="email" id="email" placeholder="User Name" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">
Mobile
</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="mobile" id="mobile" placeholder="Mobile" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">
University</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="uni" id="uni" placeholder="University" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">
User Type
</label>
<div class="col-sm-10">
<select class="form-control" name="type" id="type">
<option selected disabled>User Type</option>
<option value="Admin">Admin</option>
<option value="Student">Student</option>
<option value="Company">Company</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">
GPA</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="gpa" id="gpa" placeholder="GPA" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">
Address</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="address" id="address" placeholder="Address" />
</div>
</div>
<div class="row">
<div class="col-sm-2">
</div>
<div class="col-sm-10">
<input type="submit" class="btn btn-primary btn-sm" name="buttonregister" id="buttonregister" value="Submit and Save">
<button type="button" class="btn btn-default btn-sm">
Cancel
</button>
</div>
</div>
</form>
</div>
</div>
<div id="OR" class="hidden-xs">
OR</div>
</div>
<div class="col-md-4">
<div class="row text-center sign-with">
<div class="col-md-12">
<h3>
Sign in with
</h3>
</div>
<div class="col-md-12">
<div class="btn-group btn-group-justified">
Facebook <a href="#" class="btn btn-danger">
Google
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
php code
<?php
$conn=mysqli_connect("localhost","root","","internship");
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
if(isset($_POST['buttonsubmit'])){
$username=$_POST['username2'];
$password=$_POST['pwd2'];
$type=$_POST['utype'];
$result=mysqli_query($conn,'select * from registration where username="'.$username.'" and password="'.$password.'" and usertype="'.$type.'"');
if(mysqli_num_rows($result)==1 && $type=="Student"){
header('Location: student.php');
}
else
?>
<script> alert("Account invalid!!!! Enter valid Username Password and Usertype")</script>
<?php
}
?>
<?php
$conn=mysqli_connect("localhost","root","","internship");
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
if(isset($_POST['buttonsubmit'])){
$username=$_POST['username2'];
$password=$_POST['pwd2'];
$type=$_POST['utype'];
$result=mysqli_query($conn,'select * from registration where username="'.$username.'" and password="'.$password.'" and usertype="'.$type.'"');
if(mysqli_num_rows($result)==1 && $type=="Student"){
session_start();
$_SESSION['user'] = $result;
header('Location: student.php');
}
else
?>
<script> alert("Account invalid!!!! Enter valid Username Password and Usertype")</script>
<?php
}
Can you post the error that you are getting...?
Plus Your code is not secure. You should use php's hash functions to match passwords and use must use PDO to avoid sql injection.

Displaying data from database in bootstrap modal form(PHP&MySQL)

I am new to both bootstrap and php. I have created a registration modal form to register users for my site and it registers perfectly. However, I would like to retrieve a users details from my database based on their User ID and display their details in a registration form for them to edit and update.
What I don't know how to do is display the records in the form fields...
Please help by providing a simple syntax for this.
I am using PHP and MySql
This is my modal form
<div class="modal fade" id="updatelecModal" tabindex="-1" role="dialog" aria-labelledby="updatelecModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<!--End of modal-->
<!-- Start of form-->
<form id="updatelecForm" class="form-horizontal" role="form" method="post" action="#" nonvalidate>
<div class="form-group">
<label for="student_id" class="col-sm-3 control-label">Lecturer ID</label>
<div class="col-lg-9">
<input type="text" class="form-control" name="lec_id" required placeholder="Enter User ID">
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Full name</label>
<div class="col-lg-4">
<input type="text" class="form-control" name="firstName" required placeholder="First name" />
</div>
<div class="col-lg-4">
<input type="text" class="form-control" name="lastName" required placeholder="Last name" />
</div>
</div>
<div class="form-group">
<label for="email" class="col-sm-3 control-label">Email</label>
<div class="col-lg-9">
<input type="email" class="form-control" name="lec_email" required placeholder="#######.com">
</div>
</div>
<label class="col-xs-3 control-label" name="lec_gender">Gender:</label>
<label class="radio-inline control-label">
<input type="radio" name="optionsRadio" id="gender" value="Male">Male
</label>
<label class="radio-inline control-label">
<input type="radio" name="optionsRadio" id="gender" value="Female">Female
</label>
<div class="form-group">
<label for="password" class="col-sm-3 control-label">Password</label>
<div class="col-sm-7">
<input type="password" id="password" class="form-control" name="password" required placeholder ="Enter your Password">
</div>
</div>
<div class="form-group">
<label for="password" class="col-sm-3 control-label">Confirm Password</label>
<div class="col-sm-7">
<input type="password" id="password2" class="form-control" name="cpassword" data-validate-linked="password" required placeholder ="Re-enter your Password">
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Register</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="reset" class="btn btn-default">Reset</button>
</div>
</form>
<!--End of registration form-->
</div>
</div>
</div>
</div>
I dont know how to include the php in this form as it disappears
Also if you could include links for further reading on php I would really appreciate.
Without seeing any code it's difficult to give more specific help. However, what I would do is store the user's id in a session. When they view the form brab the id from the session and do a SQL call to your db, something like:
SELECT firstName,lastName,email, FROM table_name WHERE id=$id
Obviously what you select, the table_name, and the where clause depends on your own tables and variables.
Run your SQL command and store the columns into variables. Then place the variable into the value of the input:
<input type="text" value="<?php echo $name != '' ? $name : ''; ?>" />
Basically, what I did above is a shorthand if statement that says if $name isn't blank they print it, otherwise print nothing.

Multiple forms on page with a Bootstrap 3 Modal

I'm having an issue getting my second of two forms on a single html to process data. I'm using Bootstrap 3 framework and have a form in a modal that processes correctly i.e. a user clicks the submit button and the form is processed correctly.
There is another form on the page which does not process correctly. When a user clicks the submit button, the form is supposed to be processed and bring the user to a new page (goodsub.html) but when the submit button is clicked, nothing happens. Is there something wrong with my HTML?
I am very new to PHP so I used some pre-made PHP documents that seem to work fine for the first form on the page. Note that when I comment out the form within the modal, my "second" form processes correctly and sends the user to goodsub.html.
Page in question can be viewed at http://josephsamora.com/contact.html
Here is my code for the working:
<!--modal-->
<div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">I look forward to hearing from you.</h3>
</div>
<div class="modal-body">
<form id="personalform" name="personalform" action="mail_form.php" method="post" class="form-horizontal col-sm-12">
<div class="form-group"><input class="form-control required" placeholder="Your name*" data-placement="top" data-trigger="manual" data-content="Must be at least 3 characters long, and must only contain letters." type="text" name="Name"></div>
<div class="form-group"><textarea name="Message" class="form-control" placeholder="Your message here..*" data-placement="top" data-trigger="manual"></textarea></div>
<div class="form-group"><input name="email" class="form-control email" placeholder="email#you.com (so that I can contact you)*" data-placement="top" data-trigger="manual" data-content="Must be a valid e-mail address (user#gmail.com)" type="text"></div>
<div class="form-group"><input type="hidden" name="recipients"
value="walshv10#gmail.com" />
<input type="hidden" name="good_url" value="goodsub.html" />
<input type="hidden" name="bad_url" value="badsub.html" /></div>
<div class="form-group"><input Name="Phone Number" class="form-control phone" placeholder="Phone Number: 999-999-9999" data-placement="top" data-trigger="manual" data-content="Must be a valid phone number (999-999-9999)" type="text"></div>
<div class="form-group"><button type="submit" name="Sendit" value="Sendit" class="btn btn-success pull-right">Send It!</button> <p class="help-block pull-left text-danger hide" id="form-error"> The form is not valid. </p></div>
</form>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
</div>
</div>
And the non-working form:
<div class="row">
<div class="col-md-4 col-md-offset-4">
<form id="fullform" name="fullform" action="mail_form.php" method="post" class="form-horizontal" role="form">
<!--Hidden Section-->
<div class="form-group"><input type="hidden" name="recipients"
value="walshv10#gmail.com"/>
<input type="hidden" name="good_url" value="goodsub.html" />
<input type="hidden" name="bad_url" value="badsub.html" /></div>
<!-- Form Section Name -->
<h3>Name & Email</h3>
<hr>
<!-- Text Input -->
<div class="form-group">
<label class="col-sm-3 control-label">First Name*</label>
<div class="col-sm-9">
<input type="text" placeholder="First Name" class="form-control" data-placement="top" data-trigger="manual" name="First Name" required="">
</div>
</div>
<!-- Text Input -->
<div class="form-group">
<label class="col-sm-3 control-label">Last Name*</label>
<div class="col-sm-9">
<input type="text" placeholder="Last Name" class="form-control" data-placement="top" data-trigger="manual" name="Last Name" required="">
</div>
</div>
<!-- Text Input -->
<div class="form-group">
<label class="col-sm-3 control-label">Email*</label>
<div class="col-sm-9">
<input type="text" placeholder="Email" class="form-control" data-placement="top" data-trigger="manual" name="Email" required="">
</div>
</div>
<!-- Form Section Name -->
<h3>Address Details</h3>
<hr>
<!-- Text input-->
<div class="form-group">
<label class="col-sm-2 control-label">Line 1</label>
<div class="col-sm-10">
<input type="text" placeholder="Address Line 1" class="form-control" data-placement="top" data-trigger="manual" name="Address Line 1">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-sm-2 control-label">Line 2</label>
<div class="col-sm-10">
<input type="text" placeholder="Address Line 2" class="form-control" data-placement="top" data-trigger="manual" name="Address Line 2">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-sm-2 control-label">City</label>
<div class="col-sm-10">
<input type="text" placeholder="City" class="form-control" data-placement="top" data-trigger="manual" name="City">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-sm-2 control-label">State</label>
<div class="col-sm-4">
<input type="text" placeholder="State" class="form-control" data-placement="top" data-trigger="manual" name="State">
</div>
<label class="col-sm-2 control-label">Postcode</label>
<div class="col-sm-4">
<input type="text" placeholder="Post Code" class="form-control" data-placement="top" data-trigger="manual" name="Post code">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-sm-2 control-label">Country</label>
<div class="col-sm-10">
<input type="text" placeholder="Country" class="form-control" data-placement="top" data-trigger="manual" name="Country">
</div>
</div>
<!-- Form Section Name -->
<h3>Other Contact Info</h3>
<hr>
<!--Text Input -->
<div class="form-group">
<label class="col-sm-3 control-label">Phone Number</label>
<div class="col-sm-9">
<input type="text" placeholder="Phone Number" class="form-control" data-placement="top" data-trigger="manual" name="Phone Number">
</div>
</div>
<!--Text Input -->
<div class="form-group">
<label class="col-sm-3 control-label">Organization</label>
<div class="col-sm-9">
<input type="text" placeholder="Organization" class="form-control" data-placement="top" data-trigger="manual" name="Organization">
</div>
</div>
<!-- Form Section Name -->
<h3>Message</h3>
<hr>
<!--Text Input -->
<div class="form-group">
<label class="col-sm-2 control-label">Subject</label>
<div class="col-sm-10">
<input type="text" placeholder="Subject" class="form-control" data-placement="top" data-trigger="manual" name="Subject">
</div>
</div>
<!-- Textarea -->
<div class="form-group">
<label class="col-sm-2 control-label" for="Message">Message*</label>
<div class="col-sm-10">
<textarea class="form-control" id="Message" name="Message" placeholder="Message" required data-placement="top" data-trigger="manual"></textarea>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="pull-right">
<div class="form-group"><button type="submit" name="submit" value="submit" class="btn btn-success pull-right">Submit</button></div>
</div>
</div>
</div>
</form>
</div>
</div>
I also have the following PHP above the head tag:
<?php
if (!empty($_POST['submit'])) {
//send to submit;
}
if (!empty($_POST['Sendit'])) {
//send to Sendit;
}
?>
Thanks!
remove this section from your non working form
<!--Hidden Section-->
<div class="form-group"><input type="hidden" name="recipients"
value="walshv10#gmail.com"/>
<input type="hidden" name="good_url" value="goodsub.html" />
<input type="hidden" name="bad_url" value="badsub.html" /></div>

Categories