Confirmation message in same page after submission - forms

I buy a Dreamweaver template and it comes with a Form page.But when I submit the message it sends me to another page with only text in it.
So I want to change it, so it can display a message after the submit buttom.
This is the CONTACT FORM inserted in a HTML page:
<div class="col-sm-6 col-xs-12">
<div class="status alert alert-success contact-status"></div>
<form id="main-contact-form" class="contact-form" name="contact-form" method="post" action="sendemail.php" role="form">
<div class="row">
<!-- Name Field Starts -->
<div class="col-md-6">
<div class="form-group">
<label for="name" class="sr-only">Nombre: </label>
<input type="text" class="form-control" name="name" id="name" required placeholder="NOMBRE">
</div>
</div>
<!-- Name Field Ends -->
<!-- Email Field Starts -->
<div class="col-md-6">
<div class="form-group">
<label for="email" class="sr-only">Correo Electrónico: </label>
<input type="text" class="form-control" name="email" id="email" required placeholder="EMAIL">
</div>
</div>
<!-- Email Field Ends -->
<!-- Phone No Field Starts -->
<div class="col-md-6">
<div class="form-group">
<label for="phoneno" class="sr-only">Teléfono: </label>
<input type="text" class="form-control" name="phoneno" id="phoneno" required placeholder="TELÉFONO (10 DÍGITOS)">
</div>
</div>
<!-- Phone No Field Ends -->
<!-- Message Field Starts -->
<div class="col-xs-12">
<div class="form-group">
<label for="message" class="sr-only">Mensaje: </label>
<textarea class="form-control" rows="8" name="message" id="message" required placeholder="MENSAJE"></textarea>
</div>
</div>
<!-- Message Field Ends -->
<div class="col-xs-12">
<input type="submit" class="btn btn-lg btn-block btn-secondary text-uppercase" value="Enviar Mensaje">
</div>
</div>
</form>
</div>
<!-- Contact Form Ends -->
And this is the sendemail.php
<?php
header('Content-type: application/json');
$status = array(
'type'=>'success',
'message'=>'Email sent!'
);
$name = #trim(stripslashes($_POST['name']));
$email = #trim(stripslashes($_POST['email']));
$phoneno = #trim(stripslashes($_POST['phoneno']));
$subject = #trim(stripslashes($_POST['subject']));
$message = #trim(stripslashes($_POST['message']));
$email_from = $email;
$email_to = 'myemail#domain.com';
$body = 'Name: ' . $name . "\n\n" . 'Email: ' . $email . "\n\n" . 'Phone NO: ' . $phoneno . "\n\n" . 'Subject: ' . $subject . "\n\n" . 'Message: ' . $message;
$success = #mail($email_to, $subject, $body, 'From: <'.$email_from.'>');
echo json_encode($status);
die;
?>
Hopping you can help me

Related

PHP - form method="post"

I'm trying to make login form method=POST but if click button submit on the next page php inform me:
Notice: Undefined index: username in C:\xampp\htdocs\Kurs\odbierz.php
on line 99
Notice: Undefined index: haslo in C:\xampp\htdocs\Kurs\odbierz.php on
line 100
login page(post.php):
<body>
<div id="form">
<form name="loginform" method="POST" action="odbierz.php" enctype="multipart/form-data">
<div id="odbierz">
<div id="login">
Login: <input id="log" type="text" name="username" value="" maxlength="20" size="30" required />
<div id="pass">
<br />
Password: <input id="pass" type="password" name="haslo" value="" maxlength="20" size="30" required />
</div>
<div id="input">
<input type="submit" name="submit" value="Zaloguj Się" />
</div>
</div>
</div>
</form>
</div>
</body>
action page(odbierz.php):
<?php
echo $pagname;
if($_SERVER["REQUEST_METHOD"] == "POST")
if(isset($_POST['username']) && isset($_POST['haslo']))
echo "Hello ".$_POST["username"]." ".$_POST["haslo"];
else
echo "Coś poszło nie tak<br />";
else
echo "Coś poszło nie tak<br />";
?>
Thanks any helping Person.

How to make textfield automatic field when dropdown is selected in codeigniter

Hallo i'm new in codeigniter, i want to make textinput filled after selected value of dropdown, can anyone give an example for me (for models, conntroller and view) ? thx
here is my dropdown form
<div class="form-group">
<?php $id = 'id="nama" class="form-control input-md" required';
echo form_dropdown('nama',$nama_cabang,'',$id)?>
<div class="invalid-feedback">
<?php echo form_error('nama_cabang') ?>
</div>
</div>
and its my textinput
<div class="form-group">
<input class="form-control <?php echo form_error('kode_cabang') ? 'is-invalid':'' ?>"
type="text" name="kode" placeholder="Kode Cabang" />
<div class="invalid-feedback">
<?php echo form_error('kode_cabang') ?>
</div>
</div>
how can the value of textinput changed when dropdown is selected.
You could use javascript onchange listener to set the trigger, and assign the text input with the current selected value using this.value :
<div class="form-group">
<?php $id = 'id="nama" class="form-control input-md" required onchange="document.getElementById(\'kodeCabang\').value = this.value"';
echo form_dropdown('nama',$nama_cabang,'',$id)?>
<div class="invalid-feedback">
<?php echo form_error('nama_cabang') ?>
</div>
</div>
And add an id attribute (id="kodeCabang") to set the target element :
<div class="form-group">
<input class="form-control <?php echo form_error('kode_cabang') ? 'is-invalid':'' ?>" id="kodeCabang"
type="text" name="kode" placeholder="Kode Cabang" />
<div class="invalid-feedback">
<?php echo form_error('kode_cabang') ?>
</div>
</div>

Form not passing data to php file while using bootstrap

I am trying to create a modal that will allow a user to enter some data and then have php send an email with this data.
I have a form in the modal and the php sends the email however I cannot seem to get/use the data within the form as it doesn't seem to recover anything when I use the $_POST. Can someone please help as this is driving me mad.
Code is listed below
<!-- Modal -->
<div class="modal fade" id="modalform" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<button type="button" class="close"
data-dismiss="modal">
<span aria-hidden="true">×</span>
<span class="sr-only">Close</span>
</button>
<h4 class="modal-title" id="myModalLabel">
Submit your details to have a Sales Assistant call you back
</h4>
</div>
<!-- Modal Body -->
<div class="modal-body">
<form role="form" method="post" action="enquire.php">
<div class="form-group">
<label for="InputName">Your Name</label>
<input type="text" class="form-control"
id="InputName" placeholder="Your Name"/>
</div>
<div class="form-group">
<label for="InputCar">Car Type</label>
<input type="text" class="form-control"
id="InputCar" placeholder="Car you are interested in"/>
</div>
<div class="form-group">
<label for="InputContact">Phone Number</label>
<input type="text" class="form-control"
id="InputContact" placeholder="A number for us to contact you on"/>
</div>
<button type="submit" class="btn btn-default" value="submit">Submit</button>
</form>
</div>
<!-- Modal Footer -->
<div class="modal-footer">
<h4>Alternatively you can call us on </h4>
</div>
</div>
</div>
php
<?php
$InputName = $_POST['InputName'];
$InputCar = $_POST['InputCar'];
$InputContact = $_POST['InputContact'];
$from = "made up email address";
$to = "another made up email address";
$subject = "Enquiry from web page";
$message = "$InputName is interested in $InputCar. Contact them on $InputContact";
$headers = "From: $from \r\n";
$headers .= "Reply-To: $from \r\n";
$headers .= "Return-Path: $from\r\n";
$headers .= "X-Mailer: PHP \r\n";
mail($to, $subject, $message, $headers);
if(mail($to,$subject,$message,$headers))
{
echo "Mail sent OK";
}
else
{
echo "Error sending email!";
}
?>
Your forms were all wrong.. This is how the form should be.
<form action="" method="post">
<div class="form-group">
<label>Your Name</label>
<input type="text" class="form-control" name="name" placeholder="Your Name">
</div>
<div class="form-group">
<label>Car Type</label>
<input type="text" class="form-control" name="car" placeholder="Car you are interested in">
</div>
<div class="form-group">
<label>Phone Number</label>
<input type="text" class="form-control" name="phone" placeholder="A number for us to contact you on">
</div>
<input type="submit" class="btn btn-default" value="submit" name="send">
</form>
Your PHP should then be:
if (isset($_POST['send'])) {
$InputName = $_POST['name'];
$InputCar = $_POST['car'];
$InputContact = $_POST['phone'];
// do code
}
EDIT: under form action="" you need to add your PHP file again.

Facebook APP to create posts for fanpage stopped working

Im using a script, hosted on my server to create sheduled posts for a few facebook fanpages. Im the admin of the app but not the creator. The guys who created the script does not support the script anymore...
EDIT: By stopped working i mean - the process of the upload in the backend of the script runs as always, but the sheduled posts are not generated in facebook. Nothing there... Normally all the images should listed in my planned posts section of the fanpage. I cant find the error. The app is also not blocked.
The current app (facebook 2.0 API) uses submission for manage_pages and publish_pages. When i access the app and try to upload images, the fb entry dialog to the app shows up following Message:
Submit for Login Review
Some of the permissions below have not been approved for use by Facebook.
I submited a review for the app and get following answers for each submission:
for "publish_pages" & "manage_pages":
Your app needs permission for their current functionality. You may have to request another authorization or you can public_profile use the property for their use you need a separate authorization.
Notes From Your Reviewer:
You don’t need any extended permissions for an app that you admin. App admins, and any account listed as a ‘role’ in the App Settings page, can access all permissions without submitting for review. You only need to submit for review if the users/customers of your app are using the permissions to enhance their experience in-app
I already tried a dozen of tutorials, the publish_action submission and so on - no luck or not enough knowledge. Maybe the second one :)
Here is the index.php of the script: (Any help will be greatly appreciated!)
<?php
define('PATH', dirname(__file__));
session_start();
if(!isset($_SESSION['logged']) || $_SESSION['logged']!=true){
header("Location: login.php");
exit(0);
}
require_once(PATH . '/lang.php');
require_once(PATH . '/config.php');
require_once(PATH . '/createDatabase.php');
if(isset($_GET['id']) && is_numeric($_GET['id'])){
$db->delete("pages", "ID", $_GET['id']);
echo '<script type="text/javascript">
<!--
window.location = "index.php"
//-->
</script>';
exit(0);
}
require_once(PATH . '/header.php');
if (isset($_POST['rss'])) {
if(strlen($_POST['rss'])>5){
$db->insert("rss",array('url' => strip_tags($_POST['rss'])));
}
}
if(!function_exists('curl_init')){
echo '<div class="alert alert-error">
<button type="button" class="close" data-dismiss="alert">×</button>
' . $l['errorcurl'] . '
</div>';
exit(0);
}
if(!isset($idApp) || $idApp == ""){
echo '<div class="alert alert-error">
<button type="button" class="close" data-dismiss="alert">×</button>
' . $l['errorappid'] . '
</div>';
exit(0);
}
if(!isset($appSecret) || $appSecret == ""){
echo '<div class="alert alert-error">
<button type="button" class="close" data-dismiss="alert">×</button>
' . $l['errorappsecret'] . '
</div>';
exit(0);
}
if(!isset($canvasUrl) || $canvasUrl == ""){
echo '<div class="alert alert-error">
<button type="button" class="close" data-dismiss="alert">×</button>
' . $l['errorcanvas'] . '
</div>';
exit(0);
}
if(!isset($folder) || $folder == ""){
echo '<div class="alert alert-error">
<button type="button" class="close" data-dismiss="alert">×</button>
' . $l['errorfolder'] . '
</div>';
exit(0);
}
if(isset($_FILES["zip_file"]["name"])) {
$filename = $_FILES["zip_file"]["name"];
$source = $_FILES["zip_file"]["tmp_name"];
$type = $_FILES["zip_file"]["type"];
$name = explode(".", $filename);
$accepted_types = array('application/zip', 'application/x-zip-compressed', 'multipart/x-zip', 'application/x-compressed');
foreach($accepted_types as $mime_type) {
if($mime_type == $type) {
$okay = true;
break;
}
}
$continue = strtolower($name[1]) == 'zip' ? true : false;
if(!$continue) {
$message = '<div class="alert alert-error">
<button type="button" class="close" data-dismiss="alert">×</button>
' . $l['errorzip'] . '
</div>';
}
$target_path = PATH . "/" . $folder . "/" .$filename; // change this to the correct site path
if(move_uploaded_file($source, $target_path)) {
$zip = new ZipArchive();
$x = $zip->open($target_path);
if ($x === true) {
$zip->extractTo(PATH . "/" . $folder . "/"); // change this to the correct site path
$zip->close();
unlink($target_path);
}
$message = '<div class="alert alert-success">
<button type="button" class="close" data-dismiss="alert">×</button>
' . $l['successzip'] . '
</div>';
} else {
$message = '<div class="alert alert-error">
<button type="button" class="close" data-dismiss="alert">×</button>
' . $l['errorupload'] . '
</div>';
}
}
if(isset($_POST['deleteFolder'])){
function rrmdir($dir) {
if (is_dir($dir)) {
$objects = scandir($dir);
foreach ($objects as $object) {
if ($object != "." && $object != "..") {
if (filetype($dir."/".$object) == "dir") rmdir($dir."/".$object); else unlink($dir."/".$object);
}
}
reset($objects);
rmdir($dir);
}
}
if(is_dir(PATH . '/' . $_POST['deleteFolder'])){
rrmdir(PATH . '/' . $_POST['deleteFolder']);
}
}
?>
<div class="container-fluid">
<div class="row-fluid">
<hr>
<div id="tab" class="nav nav-pills pull-right" data-toggle="buttons-radio">
<?php echo $l['config'];?>
<?php echo $l['pages'];?>
<?php echo $l['posts'];?>
<?php echo $l['folders'];?>
<?php echo $l['liveposts'];?>
<?php echo $l['logout'];?>
</div>
<br clear="all" />
<div class="tab-content">
<div class="tab-pane active" id="prices2">
<br>
<div class="alert alert-info"><?php echo $l['configinfo'];?></div>
<p class="lead"><?php echo $l['config'];?></p>
<!--Body content-->
<legend><?php echo $l['configproblems'];?></legend>
<?php
if (count($db->selectAll("config"))>0) {
echo '<button class="btn btn-success">' . $l['youhavetoken'] . '</button>';
echo '<button class="btn btn-info">' . $l['renewtoken'] . '</button>';
} else {
echo '<button class="btn btn-info">' . $l['gettoken'] . '</button>';
}
?>
</div>
<div class="tab-pane" id="features2">
<br>
<div class="alert alert-info">
<?php echo $l['pagesinfo'];?>
</div>
<p class="lead"><?php echo $l['pages'];?></p>
<form class="form-horizontal" method="POST">
<fieldset>
<!-- Form Name -->
<legend><?php echo $l['addpages'];?></legend>
<!-- Text input-->
<div class="control-group">
<label class="control-label" for="page"><?php echo $l['pageurl'];?></label>
<div class="controls">
<input id="page" name="page" type="text" placeholder="https://www.facebook.com/your-page-url" class="input-xlarge" required="">
<p class="help-block"><?php echo $l['pageurl'];?></p>
</div>
</div>
<!-- Button -->
<div class="control-group">
<label class="control-label" for="add"></label>
<div class="controls">
<button id="add" name="add" class="btn btn-success"><?php echo $l['add'];?></button>
</div>
</div>
</fieldset>
</form>
<?php
if (isset($_POST['page'])) {
$resultToken = $db->selectAll("config");
if(isset($resultToken[0]['token']))
$token = $resultToken[0]['token'];
function getSslPage($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
$info = json_decode(getSslPage('https://graph.facebook.com/' . $_POST['page'] . '?access_token=' . $token));
if(isset( $info->name)){
$album = json_decode(getSslPage('https://graph.facebook.com/' . $info->id . '/albums?fields=id&access_token=' . $token));
$fotoAlbum = "";
foreach ($album->data as $key => $value) {
if($fotoAlbum=="" || #$album->data[$key]->name == "Timeline Photos"){
$fotoAlbum = #$album->data[$key]->id;
}
}
$db->insert("pages",array('ID' => $info->id , 'url' => $info->name, 'idalbum' => $fotoAlbum));
unset($_POST);
}
}
$result = $db->selectAll("pages");
if(!empty($result)){
echo '<table class="table table-striped" id="example">
<thead>
<tr>
<td>' . $l['name'] . '</td>
<td>' . $l['id'] . '</td>
<td>' . $l['open'] . '</td>
<td>' . $l['delete'] . '</td>
</tr>
</thead>
<tbody>';
foreach ($result as $value){
echo '<tr><td>' , $value['url'] , '</td><td>' , $value['ID'] , '</td><td><a target="_blank" href="https://www.facebook.com/' , $value['ID'] , '">' . $l['open'] . '</a></td><td>' . $l['delete'] . '</td></tr>';
}
echo '</tbody></table>';
}
?>
</div>
<div class="tab-pane" id="folders">
<br>
<div class="alert alert-info"><?php echo $l['foldersinfo'];?></div>
<p class="lead"><?php echo $l['folders'];?></p>
<legend><?php echo $l['uploadzipfolders'];?></legend>
<?php if(isset($message)) echo "<p>$message</p>"; ?>
<form enctype="multipart/form-data" method="post" action="">
<label><?php echo $l['choosezip'];?>: <input type="file" name="zip_file" /></label>
<br />
<input type="submit" name="submit" value="<?php echo $l['upload'];?>" />
</form>
<legend><?php echo $l['deletefolder'];?></legend>
<form method="post" action="">
<select id="deleteFolder" name="deleteFolder" class="input-xlarge" required>
<?php
$folders = glob(PATH . '/' . $folder . "/*", GLOB_ONLYDIR );
foreach ($folders as $subfolder){
$subfolder = explode('/', $subfolder);
echo '<option value="' , $folder , '/', $subfolder[count($subfolder)-1] , '">' , $folder , '/', $subfolder[count($subfolder)-1] , '/' , '</option>';
}
?>
</select><br />
<input type="submit" name="submit" value="<?php echo $l['deletefolder'];?>" />
</form>
<legend><?php echo $l['uploadimagestofolder'];?></legend>
<select id="puthere" name="puthere" class="input-xlarge" required>
<?php
echo '<option value="' , $folder , '">' , $folder , ' (root) </option>';
$folders = glob(PATH . '/' . $folder . "/*", GLOB_ONLYDIR );
foreach ($folders as $subfolder){
$subfolder = explode('/', $subfolder);
echo '<option value="' , $folder , '/', $subfolder[count($subfolder)-1] , '">' , $folder , '/', $subfolder[count($subfolder)-1] , '/' , '</option>';
}
?>
</select>
<div id="file-uploader-demo1">
<noscript>
<p><?php echo $l['enablejavascript'];?></p>
<!-- or put a simple form for upload here -->
</noscript>
</div>
<div class="qq-upload-extra-drop-area"><?php echo $l['dropfiles'];?></div>
</div>
<div class="tab-pane" id="live">
<div class="alert alert-info"><?php echo $l['rssinfo'];?></div>
<form class="form-horizontal" method="POST">
<fieldset>
<!-- Form Name -->
<legend><?php echo $l['addyourrss'];?></legend>
<!-- Text input-->
<div class="control-group">
<label class="control-label" for="page"><?php echo $l['rssurl'];?></label>
<div class="controls">
<input id="rss" name="rss" type="text" placeholder="https://www.something.com/rss" class="input-xlarge" required="">
<p class="help-block"><?php echo $l['rssurl'];?></p>
</div>
</div>
<!-- Button -->
<div class="control-group">
<label class="control-label" for="add"></label>
<div class="controls">
<button id="add" name="add" class="btn btn-success"><?php echo $l['add'];?></button>
</div>
</div>
</fieldset>
</form>
<legend><?php echo $l['startpostlive'];?></legend>
<?php echo $l['startpostlive'];?>
<!-- Select Basic -->
<div class="control-group">
<label class="control-label"><?php echo $l['pickyourrss'];?></label>
<div class="controls">
<select id="urlRss" name="urlRss" class="input-xlarge" multiple required>
<?php
$result = $db->selectAll("rss");
if(!empty($result)){
foreach ($result as $value){
echo '<option value="' , $value['url'] , '">' , $value['url'] , '</option>';
}
}
?>
</select>
</div>
</div>
<!-- Select Basic -->
<div class="control-group">
<label class="control-label"><?php echo $l['pages'];?></label>
<div class="controls">
<select id="pageRss" name="pageRss" class="input-xlarge" multiple required>
<?php
$result = $db->selectAll("pages");
if(!empty($result)){
foreach ($result as $value){
echo '<option value="' , $value['ID'] , '">' , $value['url'] , '</option>';
}
}
?>
</select>
</div>
</div>
<!-- Select Basic -->
<div class="control-group">
<label class="control-label"><?php echo $l['timetocheck'];?></label>
<div class="controls">
<select id="timeRss" name="timeRss" class="input-xlarge" required>
<option value="5">5 <?php echo $l['minutes'];?></option>
<option value="10">10 <?php echo $l['minutes'];?></option>
<option value="15">15 <?php echo $l['minutes'];?></option>
<option value="20">20 <?php echo $l['minutes'];?></option>
<option value="30">30 <?php echo $l['minutes'];?></option>
<option value="45">45 <?php echo $l['minutes'];?></option>
<option value="60">60 <?php echo $l['minutes'];?></option>
</select>
</div>
</div>
<button id="startRss" name="startRss" class="btn btn-success"><?php echo $l['startposting'];?></button>
<button id="stopRss" name="stopRss" class="btn btn-info" style="display:none" onClick="window.location.reload()"><?php echo $l['stopposting'];?></button>
<div id="postsDone"></div>
</div>
<div class="tab-pane" id="requests2">
<br>
<p class="lead"><?php echo $l['posts'];?></p>
<form class="form-horizontal" onsubmit="return false;" id="formPosts">
<fieldset>
<div class="alert alert-info"><?php echo $l['postsinfo'];?></div>
<!-- Form Name -->
<legend><?php echo $l['generateposts'];?></legend>
<!-- Select Basic -->
<div class="control-group">
<label class="control-label"><?php echo $l['folder'];?></label>
<div class="controls">
<select id="subfolder" name="subfolder" class="input-xlarge" required>
<?php
echo '<option value="' , $folder , '">' , $folder , ' (root) </option>';
$folders = glob(PATH . '/' . $folder . "/*", GLOB_ONLYDIR );
foreach ($folders as $subfolder){
$subfolder = explode('/', $subfolder);
echo '<option value="' , $folder , '/', $subfolder[count($subfolder)-1] , '">' , $folder , '/', $subfolder[count($subfolder)-1] , '/' , '</option>';
}
?>
</select>
</div>
</div>
<!-- Select Basic -->
<div class="control-group">
<label class="control-label"><?php echo $l['pages'];?></label>
<div class="controls">
<select id="page" name="page[]" class="input-xlarge" multiple required>
<?php
$result = $db->selectAll("pages");
if(!empty($result)){
foreach ($result as $value){
echo '<option value="' , $value['ID'] , '">' , $value['url'] , '</option>';
}
}
?>
</select>
</div>
</div>
<!-- Select Basic -->
<div class="control-group">
<label class="control-label"><?php echo $l['usefilename'];?></label>
<div class="controls">
<select id="useimagename" name="useimagename" class="input-xlarge" required>
<?php
echo '<option value="0">' , $l['no'] , '</option>';
echo '<option value="1">' , $l['yes'] , '</option>';
?>
</select>
</div>
</div>
<!-- Select Basic -->
<div class="control-group">
<label class="control-label"><?php echo $l['deletefiles'];?></label>
<div class="controls">
<select id="deletefiles" name="deletefiles" class="input-xlarge" required>
<?php
echo '<option value="0">' , $l['no'] , '</option>';
echo '<option value="1">' , $l['yes'] , '</option>';
?>
</select>
</div>
</div>
<!-- Multiple Radios (inline) -->
<div class="control-group">
<label class="control-label"><?php echo $l['numberofposts'];?></label>
<div class="controls">
<label class="radio inline">
<input type="radio" name="numposts" value="10" checked="checked">
10
</label>
<label class="radio inline">
<input type="radio" name="numposts" value="25">
25
</label>
<label class="radio inline">
<input type="radio" name="numposts" value="50">
50
</label>
<label class="radio inline">
<input type="radio" name="numposts" value="100">
100
</label>
<label class="radio inline">
<input type="radio" name="numposts" value="250">
250
</label>
<label class="radio inline">
<input type="radio" name="numposts" value="500">
500
</label>
</div>
</div>
<div class="control-group">
<label class="control-label"><?php echo $l['timefirstpost'];?></label>
<div class="controls">
<div id="datetimepicker1" class="input-append date">
<input data-format="dd/MM/yyyy hh:mm:ss" type="text" id="dataehora" name="dataehora" required></input>
<span class="add-on">
<i data-time-icon="icon-time" data-date-icon="icon-calendar">
</i>
</span>
</div>
</div>
</div>
<!-- Multiple Radios (inline) -->
<div class="control-group">
<label class="control-label"><?php echo $l['timebettweenpost'];?></label>
<div class="controls">
<label class="radio inline">
<input type="radio" name="time" value="2m">
2 <?php echo $l['minutes'];?>
</label>
<label class="radio inline">
<input type="radio" name="time" value="3m">
3 <?php echo $l['minutes'];?>
</label>
<label class="radio inline">
<input type="radio" name="time" value="5m" checked="checked">
5 <?php echo $l['minutes'];?>
</label>
<label class="radio inline">
<input type="radio" name="time" value="10m">
10 <?php echo $l['minutes'];?>
</label>
<label class="radio inline">
<input type="radio" name="time" value="15m">
15 <?php echo $l['minutes'];?>
</label>
<label class="radio inline">
<input type="radio" name="time" value="20m">
20 <?php echo $l['minutes'];?>
</label>
<label class="radio inline">
<input type="radio" name="time" value="30m">
30 <?php echo $l['minutes'];?>
</label>
<label class="radio inline">
<input type="radio" name="time" value="1h">
1 <?php echo $l['hours'];?>
</label>
<label class="radio inline">
<input type="radio" name="time" value="2h">
2 <?php echo $l['hours'];?>
</label>
<label class="radio inline">
<input type="radio" name="time" value="3h">
3 <?php echo $l['hours'];?>
</label>
<label class="radio inline">
<input type="radio" name="time" value="4h">
4 <?php echo $l['hours'];?>
</label>
<label class="radio inline">
<input type="radio" name="time" value="5h">
5 <?php echo $l['hours'];?>
</label>
<label class="radio inline">
<input type="radio" name="time" value="6h">
6 <?php echo $l['hours'];?>
</label>
<label class="radio inline">
<input type="radio" name="time" value="12h">
12 <?php echo $l['hours'];?>
</label>
</div>
</div>
<div class="control-group">
<label class="control-label"><?php echo $l['maxpostsperday'];?></label>
<div class="controls">
<div>
<input type="text" id="postsperday" name="postsperday"></input>
</div>
</div>
</div>
<!-- Multiple Radios (inline) -->
<div class="control-group">
<label class="control-label"><?php echo $l['from'];?></label>
<div class="controls">
<label class="radio inline">
<input type="radio" name="from" value="folder" checked="checked">
<?php echo $l['randomimages'];?>
</label>
<label class="radio inline">
<input type="radio" name="from" value="file">
<?php echo $l['file'];?>
</label>
</div>
</div>
<!-- Button -->
<div class="control-group">
<label class="control-label"></label>
<div class="controls">
<button id="generatePosts" name="singlebutton" class="btn btn-success"><?php echo $l['generate'];?></button>
</div>
</div>
</fieldset>
</form>
<div class="progress progress-striped active" style="display:none">
<div class="bar" style="width: 0%;"></div>
</div>
<div id="defaultText" style="display:none">
<input type="text" val="" class="text" />
<select class="input-xlarge" required>
<?php
echo '<option value="0">' , $l['begginingempty'] , '</option>';
echo '<option value="1">' , $l['endempty'] , '</option>';
echo '<option value="2">' , $l['begginingall'] , '</option>';
echo '<option value="3">' , $l['endall'] , '</option>';
?>
</select>
<button name="singlebutton" class="btn btn-success addDescription"><?php echo $l['add']; ?></button>
</div>
<ul class="thumbnails" id="listaposts">
</ul>
<br clear="all" />
<div class="alert alert-success sucessoPost" style="display:none">
<button type="button" class="close" data-dismiss="alert">×</button>
<?php echo $l['successposts'];?>
</div>
<div class="options" style="display:none">
<div class="alert alert-error">
<button type="button" class="close" data-dismiss="alert">×</button>
<?php echo $l['dontclose'];?>
</div>
<hr>
<button id="postall" name="singlebutton" class="btn btn-success"><?php echo $l['postall'];?></button>
<a onClick="window.location.reload()" name="singlebutton" class="btn btn-error"><?php echo $l['deleteall'];?></a>
</div>
</div>
</div>
</div>
</div>
<?php
require_once(PATH . '/footer.php');
?>

Laravel 4 auto inserting </form>

I updated Laravel 4.1 recently and an exiting modal window form is not working correctly. I have figured out that for some reason after the Laravel 4.1 update, Laravel is auto inserting an tag into my modal body. (I have the Form::close() in the footer. I was just curious if anyone else has seen this or can offer an explanation of why this is happening and how to prevent it. I am good about searching through my issues, but this one is not yielding me any results.
Note that if I move my submit button into the modal-body div, then submit works as expected and updates goes through the normal process.. but for some reason with this particular modal, having the submit button in the footer puts the submit button outside of the form as the form close is auto inserted before the end of the modal-body div. Also strangely enough I have this working on another page, and everything works as expected.
Here is the relevant code:
<div class="modal-body">
<?php
$access = Session::get('user_access');
$userid = Session::get('user_id');
?>
{{ Form::open(array('method'=>'POST','route' => 'users.store', 'style' => 'display:inline')) }}
#foreach($user as $userinfo)
<!-- Set hidden form element with userid embedded -->
<input type="hidden" name='id' id='id' value={{ $userid }}>
<!-- Display the username and profile Picture -->
<h2><center>{{ $userinfo->username }}</center></h2>
<br><br>
<!-- 2 Column Form to change user information and display current status -->
<div class ='container col-md-offset-1'>
<div class='row col-md-3'>
<div>
{{ Form::label('givenname', 'First Name:') }} <br>
<input type="text" name='givenname' id='givenname' value={{ $userinfo->givenname }}>
</div><br />
<div>
{{ Form::label('surname', 'Last Name:') }} <br>
<input type="text" name='surname' id='surname' value={{ $userinfo->surname }}>
</div><br />
<div>
{{ Form::label('email', 'Email Address:') }} <br>
<input type="text" name='email' id='email' value={{ $userinfo->email }}>
</div><br />
</div>
<div class='row col-md-3'>
<div>
{{ Form::label('password', 'New Password:') }} <br>
<input type="password" name='password' id='password' value={{ $userinfo->password }}>
</div><br />
<div>
{{ Form::label('password_confirmation', 'Confirm New Password:') }} <br>
<input type="password" name='password_confirmation' id='password_confirmation' value={{ $userinfo->password }}>
</div><br />
<div>
{{ Form::label('useraccess', 'Current Subscription Status:') }} <br>
{{ $access }}
</div><br />
</div>
</div>
#endforeach
</div> <!-- End Modal Body -->
<div class="modal-footer">
{{ Form::submit('Save', array('class' => ' btn btn-warning')) }}
<!-- Close the form -->
{{ Form::close() }}
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
When I run the developer tools in the browser, I can see the auto insert
<form method="POST" action="http://dev.app.myapp.com/users" accept-charset="UTF-8"><input name="_token" type="hidden" value="<TOKEN">
<!-- Set hidden form element with userid embedded -->
<input type="hidden" name="id" id="id" value="6">
<!-- Display the username and profile Picture -->
<h2><center>johndoe123</center></h2>
<br><br>
<!-- 2 Column Form to change user information and display current status -->
<div class="container col-md-offset-1">
<div class="row col-md-3">
<div>
<label for="givenname">First Name:</label> <br>
<input type="text" name="givenname" id="givenname" value="John">
</div><br>
<div>
<label for="surname">Last Name:</label> <br>
<input type="text" name="surname" id="surname" value="Doe">
</div><br>
<div>
<label for="email">Email Address:</label> <br>
<input type="text" name="email" id="email" value="johndoe#notarealemail.com">
</div><br>
</div>
<div class="row col-md-3">
<div>
<label for="password">New Password:</label> <br>
<input type="password" name="password" id="password" value="Encrypted Password String">
</div><br>
<div>
<label for="password_confirmation">Confirm New Password:</label> <br>
<input type="password" name="password_confirmation" id="password_confirmation" value="Encrypted Password String">
</div><br>
<div>
<label for="useraccess">Current Subscription Status:</label> <br>
User </div><br>
</div>
</div>
</form>
<div class="modal-footer">
<input class=" btn btn-success" type="submit" value="Save">
<!-- Close the form -->
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
The reason is that your mark-up is lacking proper structure. You begin the <form> in some element, then close it inside another element.
Check out the page source (ALT+CMD+U on Mac). You will notice </form> exactly where you originally put Form::close() (inside <div class="modal-footer">).
That position, however, is invalid mark-up, as I mentioned before. The browser doesn't know exactly what you want, but it will try to come to a conclusion, so it correctly moves </form> down one level.
What you are seeing in developer tools is not what was printed out by Laravel, but actually how the browser interpreted your invalid mark-up.
A solution for this specific case: move Form::close() after <div class="modal-footer">.