HTML Form Sent to Email [duplicate] - php

This question already has answers here:
PHP mail function doesn't complete sending of e-mail
(31 answers)
Closed 4 years ago.
I'm having an issue with my html form sending to my email.
I have it set up so that it goes to a php file and it works fine, but when I change the filename from index.php to contact.php it doesn't send anymore.
contact.php:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style/stylesheet.css">
<script src="script/scripts.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
</head>
<body>
<div class="banner">
<img src="images/banner.jpg">
</div>
<div class="navigation">
<div class="navbar">
Home
News
<div class="dropdown">
<button class="dropbtn">Parts
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
Cases
Motherboards
Processors
Graphics Cards
Storage
Power Supplies
RAM
Other
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Builds
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
Placeholder
Placeholder
Placeholder
Placeholder
Placeholder
Placeholder
Placeholder
Placeholder
</div>
</div>
<div class="contact" id="navright">
Contact
</div>
</div>
</div>
<div class="contact_page">
<form class="contact_form" action="contactform.php" method="post">
<label>Full Name:</label><br/>
<input type="text" name="name" placeholder="Full Name"><br/>
<label>Your Email:</label><br/>
<input type="text" name="mail" placeholder="Email"><br/>
<label>Subject:</label><br/>
<input type="text" name="subject" placeholder="Subject"><br/>
<label>Message:</label><br/>
<textarea name="message" class="contacttext" placeholder="Message..."></textarea><br/>
<button class="submit" type="submit">Submit</button>
</form>
</div>
<div class="footer">
<div class="footertext">
<p>Here at Terry's Computers we do not claim to own any of
the products showed on this website.</p>
<p>Contact Us</p>
</div>
</div>
</body>
</html>
contactform.php:
<?php
if (isset($_POST['submit'])) {
$name = $_POST['name'];
$subject = $_POST['subject'];
$mailFrom = $_POST['mail'];
$message = $_POST['message'];
$mailTo = "terryjtowell#terrytowell.com";
$headers = "From: ".$mailFrom;
$txt = "You have received an Email from ".$name.".\n\n".$message;
mail($mailTo, $subject, $txt, $headers);
header("Location: contact.php?mailsend");
}
?>
It's not my web hoster because it worked with this file.
index.php:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<meta charset="UTF-8">
<title>Email Form</title>
</head>
<body>
<main>
<p class="header">E-MAIL FORM</p>
<form class="contact-form" action="contactform.php" method="post">
<p class="title">Your Name</p>
<input type="text" name="name" placeholer="Full Name"><br/>
<p class="title">Your E-Mail</p>
<input type="text" name="mail" placeholer="Your E-mail"><br/>
<p class="title">Subject</p>
<input type="text" name="subject" placeholer="Subject"><br/>
<p class="title">Message</p>
<textarea name="message" maxrows="10" placeholder="Message"></textarea><br/>
<button type="submit" name="submit"><h2>SUBMIT</h2></button><br/>
</form>
</main>
</body>
</html>

Your PHP line:
if (isset($_POST['submit'])) {
Will never execute because you need an element with the name of submit, but you have:
<button class="submit" type="submit">Submit</button>
Which you have in the example you say works. The solution should be as simple as adding a name attribute like this:
<button class="submit" name="submit" type="submit">Submit</button>

Related

Success message pop-up after from submit button clicked

I have created a web php web page with html and php code in, see below.
When I submit my form, it sends me an email and a success of fail message appears. So, everything works well.
My problem: I want to make the success or failure message pop-up or be a modal, but I don't know how. Where should I change the code and add the modal?
I have php at the top and then my HTML form. My form also has the google recaptcha verification tool. I just want to add a modal, but I do not know how and where to add the code.
<?php
error_reporting(0);
$msg="";
if (isset($_POST['submit'])) {
$to = "aleciadeklerk.119#gmail.com";
$subject = "Form Submission";
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$check = $_POST['check'];
$msgBody = 'Name: '.$name.'Message: '.$message.'Subscribe: '.$check.'E-mail: '.$email;
$headers = 'From: '.$email;
$secretKey = "6LdXbq8UAAAAAM1B79Yz2IPgcTuIynBXeJMF2ZLY";
$responseKey = $_POST['g-recaptcha-response'];
$url = "https://www.google.com/recaptcha/api/siteverify?secret=$secretKey&response=$responseKey";
$response = file_get_contents($url);
$response = json_decode($response);
if ($response->success) {
if (mail($to, $subject, $msgBody, $headers)) {
$msg="Message sent successfully!";
}
else {
$msg="Failed to send the message. Please try again.";
}
}
else {
$msg="Verification Failed";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel='stylesheet' href='https://use.fontawesome.com/releases/v5.7.0/css/all.css' integrity='sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ' crossorigin='anonymous'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="style.css">
<title>Dibene Solutions</title>
<link rel = "icon" type = "image/png" href = "images/dibene_icon_dark.png">
</head>
<body>
<div>
<div class="container-fluid" id="contact">
<div class="container">
<div class="row">
<div class="col-md-12">
<a name="contact"><h2>Contact us</h2></a>
</div>
</div>
<div class="row">
<div class="col-md-6">
<form action="<?= $_SERVER['PHP_SELF'] ?>" method="post" class="p-2">
<div class="form-group">
<input type="text" name="name" class="form-control" placeholder="Enter name" required>
</div>
<div class="form-group">
<input type="email" name="email" class="form-control" placeholder="Enter e-mail" required>
</div>
<div class="form-group">
<textarea name="message" rows="4" class="form-control" placeholder="Write your message" required></textarea>
</div>
<div class="form-group">
<label><input type="checkbox" name="check" class="form-control" checked>Subscribe to monthly newsletter.</label>
</div>
<div class="form-group">
<div class="g-recaptcha" data-sitekey="6LdXbq8UAAAAAAf7mQJqfbBbLWA36c1Qiin8EhBp"></div>
</div>
<div class="form-group">
<input type="submit" name="submit" value="Send" class="btn btn-block">
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</body>
</html>
My aim is to click the submit button and then a modal pops up with a success or failure message.
if you want to use modal as an information messages, put your modal inside your html after the body tag and then call it with a javascript after the event success or failed.
javascript used for modal: $('#myModal').modal(options).
or if you want simplier way, you can use javascript alert() to inform the success or failed event
I made few changes to the code. I included bootstrap modal code and javascript function to call pop up. check this code.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel='stylesheet' href='https://use.fontawesome.com/releases/v5.7.0/css/all.css' integrity='sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ' crossorigin='anonymous'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="style.css">
<title>Dibene Solutions</title>
<link rel = "icon" type = "image/png" href = "images/dibene_icon_dark.png">
</head>
<body>
<div>
<div class="container-fluid" id="contact">
<div class="container">
<div class="row">
<div class="col-md-12">
<a name="contact"><h2>Contact us</h2></a>
</div>
</div>
<div class="row">
<div class="col-md-6">
<form action="<?= $_SERVER['PHP_SELF'] ?>" method="post" class="p-2">
<div class="form-group">
<input type="text" name="name" class="form-control" placeholder="Enter name" required>
</div>
<div class="form-group">
<input type="email" name="email" class="form-control" placeholder="Enter e-mail" required>
</div>
<div class="form-group">
<textarea name="message" rows="4" class="form-control" placeholder="Write your message" required></textarea>
</div>
<div class="form-group">
<label><input type="checkbox" name="check" class="form-control" checked>Subscribe to monthly newsletter.</label>
</div>
<div class="form-group">
<div class="g-recaptcha" data-sitekey="6LdXbq8UAAAAAAf7mQJqfbBbLWA36c1Qiin8EhBp"></div>
</div>
<div class="form-group">
<input type="submit" name="submit" value="Send" class="btn btn-block">
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Modal Header</h4>
</div>
<div class="modal-body">
<p id="txtMsg"></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script>
function popup(msg){
document.getElementById("txtMsg").innerHTML = msg;
$("#myModal").modal();
}
</script>
<?php
error_reporting(0);
$msg="";
if (isset($_POST['submit'])) {
$to = "aleciadeklerk.119#gmail.com";
$subject = "Form Submission";
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$check = $_POST['check'];
$msgBody = 'Name: ' . $name . 'Message: ' . $message . 'Subscribe: ' . $check . 'E-mail: ' . $email;
$headers = 'From: ' . $email;
$secretKey = "6LdXbq8UAAAAAM1B79Yz2IPgcTuIynBXeJMF2ZLY";
$responseKey = $_POST['g-recaptcha-response'];
$url = "https://www.google.com/recaptcha/api/siteverify?
secret=$secretKey&response=$responseKey";
$response = file_get_contents($url);
$response = json_decode($response);
if ($response->success) {
if (mail($to, $subject, $msgBody, $headers)) {
$msg = "Message sent successfully!";
echo '<script type="text/javascript">',
'popup("'.$msg.'");',
'</script>';
} else {
$msg = "Failed to send the message. Please try again.";
echo '<script type="text/javascript">',
'popup("'.$msg.'");',
'</script>';
}
}
else {
$msg="Verification Failed";
echo '<script type="text/javascript">',
'popup("'.$msg.'");',
'</script>';
}
}
?>
</body>
</html>
You could create a hidden field like:
<input type="hidden" name="msg" id="msg" value="<?php echo $msg ?>">
Then using JQuery on document ready:
$(document).ready(function() {
if($('#msg').val() != "")
{
alert($('#msg').val()); // or replace with a JQuery modal
}
});

Email not sending with PHPmail function [duplicate]

This question already has answers here:
PHP mail function doesn't complete sending of e-mail
(31 answers)
Closed 4 years ago.
My page structure is the following
-index.php
-include send-form.php
-include contact-us-form.php
-include footer.php
my index.php file is the following (shortened)
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
</head>
<body>
<?php include 'navigation-bar.php';?>
<?php include 'contact-us-form.php';?>
<?php include 'footer.php';?>
</body>
below is my contact-us-form
<div class="container">
<div class="row">
<div class="column">
<form method="post">
<label for="name">Name*</label>
<input type="text" id="name" name="name" placeholder="Your name.." required>
<label for="email">Email*</label>
<input type="text" id="email" name="email" placeholder="Your email.." required>
<label for="message">Message*</label>
<textarea id="message" name="message" placeholder="Your Message" style="height:170px" required></textarea>
<div style="text-align: center;">
<input type="submit" value="submit" >
</div> <!-- /submit button -->
</form> <!-- /form -->
<div id="error_message" style="width:100%; height:100%; display:none; ">
<h4>Error</h4>
Sorry there was an error sending your form.
</div>
<div id="success_message" style="width:100%; height:100%; display:none; ">
<h2>Success! Your Message was Sent Successfully.</h2>
</div>
</div><!-- /column -->
<div class="column2">
</div> <!-- /column2 -->
</div> <!-- /row-->
</div> <!-- /container -->
below is my send-form.php
if (isset($_POST["submit"])){
$to = '***************#gmail.com';
$subject = 'Message from website';
$message = 'MESSAGE: ' . $_POST [ "message" ] . ' </n> NAME: ' . $_POST['name'] ;
$from = $_POST[ "email" ];
if(mail($to, $subject, $message)){
echo 'message sent';
} else{
echo 'Unable to send email. Please try again.';
}
}
For some reason the email isn't sending. I can get the email to send if I put a action="/send-form.php" in the contact form but this bring me to another page.. What I am trying to do is for the user to send the form and stay on the same page where the message which is hidden will then be unhidden when clicked.. Any help on why my email isn't sending would be greatly appreciated!
I see you used $_POST["submit"] in your code. But you didn't define it on your form.
<input type="submit" value="submit">
Just put name="submit" on it and the problem must be solved.
<input type="submit" name="submit" value="submit">

Alerts for Contact Form after being sent / error found

I myself am not good with PHP so I am wondering If someone on here can help me with my issue. My main page is the following code
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Leave a Message</title>
<link href="bootstrap.min.css" rel="stylesheet">
<link href="font-awesome.min.css" rel="stylesheet">
<link href="custom.css" rel="stylesheet">
</head>
<body id="particles">
<body id="particles">
<div class="main">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header text-center">
<h4 class="modal-title">Leave a message</h4>
</div>
<div class="modal-body">
<form method="post" action="contact_me.php">
<div class="form-group">
<label>Your name</label>
<br>
<input type="text" class-"form-control" name="name" required="" style="width: 100%;">
</div>
<div class="form-group">
<label>Your email</label>
<br>
<input type="text" class-"form-control" name="email" required="" style="width: 100%;">
</div>
<div class="form-group">
<label>Your message</label>
<br>
<textarea type="text" class-"form-control" name="message" required="" style="width: 100%; max-width: 100%; min-height: 100px"></textarea>
</div>
<div class="form-group">
<button type="submit" class="btn btn-info" style="width: 100%;">Submit</button>
</div>
</form>
</div>
<div class="modal-footer" style="text-align: center;">
<small>Copyright © 2016. All Rights Reserved.</small>
</div>
</div>
</div>
</div>
<script src="jquery.min.js"></script>
<script src="particles.jquery.min.js"></script>
<script src="custom.min.js"></script>
</body>
</html>
My action is contact_me.php and that code is
<?php
// Check for empty fields
if(empty($_POST['name']) ||
empty($_POST['email']) ||
empty($_POST['message']) ||
!filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
{
header( 'Location: http://www.wotm8.net/error-pages/contact' ) ;
return false;
} header('Location: ' . $_SERVER['HTTP_REFERER']);
$name = strip_tags(htmlspecialchars($_POST['name']));
$email_address = strip_tags(htmlspecialchars($_POST['email']));
$message = strip_tags(htmlspecialchars($_POST['message']));
// Create the email and send the message
$to = 'me#lolnick.com'; // Add your email address inbetween the '' replacing yourname#yourdomain.com - This is where the form will send a message to.
$email_subject = "Website Contact Form: $name";
$email_body = "You have received a new message from your website contact form.\n\n"."Here are the details:\n\nName: $name\n\nEmail: $email_address\n\nMessage:\n$message";
$headers = "From: noreply#yourdomain.com\n"; // This is the email address the generated message will be from. We recommend using something like noreply#yourdomain.com.
$headers .= "Reply-To: $email_address";
mail($to,$email_subject,$email_body,$headers);
return true;
?>
I am wondering If someone can teach me how to add alerts. For example If a error Is found It will show up a Red Box of Text and say Error. If the contact form is correct than It will show a Green Box of Text and say Contact Form Sent.

Find an html element by id and replace its contents with php

I have an html with submit button.
Submit sends you to php.
php code has this:
header("location:./setupOk.html");
$html = file_get_html('setupOk.html');
$ret = $html->find('div[id=valueOk]');
echo $ret[0]->innertext = "foo";
and this is some of my html setupOk.html code:
<form action="http://54.186.92.18/Pixel-Matrix/keys.php" method="post">
<div class="logo">
<link rel="stylesheet" type="text/css" href="styles.css">
<label id="logo"</label>
<!--<label for="name">Type:</label>-->
</div>
<div class="right">
<h1>Enter License Information</h1>
<div id="valueOk">
<input type="text" id="valOk" name="Key" readonly="readonly" />
</div>
</div>
<div class="button">
<button id="validateB" type="submit">Validate Now ></button>
</div>
</form>
After executing button on first html, it goes to php and reloads my html website with setupOk but no text is innered to anywhere. Any solution?
EDIT:
my goal is to have a general html (with label and images) then from php, put text to that html and automatically load this html on user's browser
EDIT2:
MY FIRST HTML ISN'T THE SAME THAN 2ND HTML. FIRST ONE SENDS POST PETITION TO PHP THEN DEPENDING ON THE INFO SENT TO PHP, PHP WILL FILL TEXT TO THE 2ND HTML AND LOAD THIS LAST HTML ON USER'S BROWSER
Avoiding DOMParser and loading/redirecting to HTML page -- you can do it more simple way like (it has to be a PHP file):
<?php
$innerText = "";
if (!empty($_POST['Key'])) {
$innerText = "foo";
}
?>
<div class="logo">
<link rel="stylesheet" type="text/css" href="styles.css">
<label id="logo"</label>
<!--<label for="name">Type:</label>-->
</div>
<div class="right">
<h1>Enter License Information</h1>
<div id="valueOk">
<input type="text" id="valOk" name="Key" readonly="readonly" value="<?php echo $innerText;?>"/>
</div>
</div>
<div class="button">
<button id="validateB" type="submit">Validate Now ></button>
</div>
If you think this is not what you want - please elaborate your need a bit.
UPDATE
setupOk.php
<form action="http://54.186.92.18/Pixel-Matrix/keys.php" method="post">
<div class="logo">
<link rel="stylesheet" type="text/css" href="styles.css">
<label id="logo"</label>
<!--<label for="name">Type:</label>-->
</div>
<div class="right">
<h1>Enter License Information</h1>
<div id="valueOk">
<input type="text" id="valOk" name="Key" readonly="readonly" />
</div>
</div>
<div class="button">
<button id="validateB" type="submit">Validate Now ></button>
</div>
</form>
keys.php [where you are submitting the form]
require_once('simple_html_dom.php');
$processedResult = "";
if (!empty($_POST['Key'])) {
$processedResult = "foo";
}
$html = file_get_html('setupOk.php');
$html->find('input[id=valOk]', 0)->value = $processedResult;
echo $html;
I have tested it and it's working.

CKeditor with 2 textareas is no sending all fields changes

I have a form in php that has 2 textareas, this form uses ckeditor in those textareas
When send it, i receive the changes of the first textarea and the data of the second textarea without changes
The html code is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<link href="../css/estilo.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../scripts/prototype.js"></script>
<script type="text/javascript" src="../scripts/dropdown_menu.js"></script>
<script type="text/javascript" src="../scripts/funciones.js"></script>
<script type="text/javascript" src="scripts/funciones.js"></script>
<script type="text/javascript" src="../../ckeditor/ckeditor.js"></script>
</head>
<body >
<div id="container">
<div id="head"></div>
<div id="menucontainer">
<ul id="menu">
<li><a id="Actualizaciones" href="../noticias/noticias.php" title="ACTUALIZACIONES" >ACTUALIZACIONES</a>
</li>
<li><a id="Correo" href="../correos/correos.php" title="CORREOS" >BOLETÍN DE NOTICIAS</a>
</li>
<li><a id="Salir" href="../usuarios/logout.php" title="SALIR" >SALIR</a>
</li>
</ul>
</div>
<div id="submenucontainer">
</div>
<script type="text/javascript">
<!--
var menu = new DropDownMenu($('menu'));
-->
</script>
<div id="menuizq">
<ul class="sec">
<li >Cambiar Contraseña
</li>
<li >Salir
</li>
</ul>
</div>
<div id="administracion">
<div id="titulo">Actualizaciones</div>
<form action="" method="post" name="form1" id="form1" target="_self" enctype="multipart/form-data" >
<div >
<div class="fm-fila " >
<div class="fm-campo" >
Titulo:<br /><input name="txt_titulo" type="text" id="txt_titulo" autocomplete="off" maxlength="60" value="Trazabilidad por Productos" tabindex="1" onKeyPress="return tabular(event,this)" class="input_pre" />
</div>
<div class="fm-campo5" >
Fecha:<br /><input name="txt_fecha" type="text" id="txt_fecha" autocomplete="off" maxlength="10" value="20/08/2013" tabindex="2" onKeyPress="return tabular(event,this)" class="input_pre" />
</div>
<div class="fm-icon" >
<img src="../img/icons/date.png" width="16" height="16" align="top" onclick="displayCalendar($('txt_fecha'),'dd/mm/yyyy',this);" style="cursor:pointer" />
</div>
</div>
<div class="fm-fila " >
<div class="fm-campo2" >
Entradilla:<br />
<textarea name="txt_entradilla" id="txt_entradilla" tabindex="3" class="ckeditor" rows="8"/>prueba 1</textarea>
</div>
</div>
<div class="fm-fila " >
<div class="fm-campo2" >
Detalle:<br />
<textarea name="txt_detalle" id="txt_detalle" tabindex="4" class="ckeditor" rows="8"/>prueba 2</textarea>
</div>
</div>
<div class="fm-fila " >
<div class="fm-campo2" style="text-align:center;">
</div>
</div>
<div class="fm-botonera" >
<input type="button" name="guardar" id="guardar" class="bto-guardar" tabindex="5" value="Guardar" onclick="javascript:validar()" style="margin:6px 0px;"/>
<input type="button" name="cancelar" id="cancelar" class="bto-cancelar" tabindex="6" value="Cancelar" onclick="location.href='noticias.php'" style="margin:6px 0px;"/>
<input type="hidden" name="txt_id" id="txt_id" value="32" />
</div>
</div>
</form>
</div>
</div>
</body>
</html>
The php code is:
<?php
echo $_POST['txt_entradilla'];
echo $_POST['txt_detalle'];
?>
If I take out the first textarea the second sends the changes and if I place first textarea "B" and then the textarea "A", the textarea "A" don’t have the changes.
I'm using CKeditor 4.2.
i upload my files to mediafire, here is the link: http://www.mediafire.com/?x73h2sjq8ku63ih

Categories