E-posta Div İçerik

2 Cevap php

Ben bir Div içeriğini e-posta çalışıyorum. Biz online rezervasyon sistemi var ve kullanıcı ne istediklerini seçenekleri seçer, daha sonra formu gönderin. Onları yazdırmak için sonraki sayfada bilgilerini görüntüler. Ben de onlara ve bize e-postayla bir kopyasını istiyorum.

Ben ajax script kullanarak Jonathon Sampson'ın e-posta div görünümünü sevdim. Ama benim için çalışmıyor. E-posta her zaman ben onu yazılı bir kelime ile basit bir Div vermek bile geri 'nullunkine diyerek geliyor.

PHP hakkında yeterli bilmiyorum ve önceden CGI kullandık. CGI ile sorun ben e-posta tarzı olamaz. PHP ile bulduk bir sorun şimdiye kadar e-posta HTML ekleyebilirsiniz rağmen ben nerede gösterilebilir istediğinizi karar ve HTML e-posta DIV'leri içeride halklar biçimlerinden döner koymak olamaz olmasıdır.

If you take a look at the following page you will get a look at the Booking PAge. This page is where the initial form submission returns its information to. Everything inside the DIV tag 'booking-quote' I want emailed to the user one way or the other. Attached is the code .

<!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=UTF-8" />
<title>Untitled Document</title>
</head>

<body>
<div align="right" style="padding-top:10px;" id="booking_quote">
  <table width="775" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><table width="775" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="18" height="30" style="background:url(../../../IMAGES_A/Structure/Headers/blue-corner-piece-left-30px.gif); background-repeat:no-repeat;">&nbsp;</td>
          <td bgcolor="#263D51" style="border-left:1px solid #FFF; border-right:1px solid #FFF; padding-left:5px;"><div align="left" class="Text_normal" style="font-size:13px; color:#FFF;">Customer Records</div></td>
          <td width="18" height="30" style="background:url(../../../IMAGES_A/Structure/Headers/blue-corner-piece-right-30px.gif); background-repeat:no-repeat;">&nbsp;</td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td style="padding-top:10px;"><div align="center">
        <table width="755" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="500"><div align="left">
              <table width="490" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td class="Corner-Box-WhiteGrey-TL" height="6" width="6"></td>
                  <td class="Corner-Box-WhiteGrey-T" height="6"></td>
                  <td class="Corner-Box-WhiteGrey-TR" height="6" width="6"></td>
                </tr>
                <tr>
                  <td class="Corner-Box-WhiteGrey-L" width="6"></td>
                  <td width="478"><table width="478" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="50%" valign="top"><div align="left" class="Text_normal">
                        <table width="230" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="77" valign="top" style="padding-right:12px;"><div align="right" style="color:#999;">Name</div></td>
                            <td width="153" valign="top" style="font-size:13px; line-height:22px; color:#333;"><div align="left"> <?php echo $_POST["CD_first-name"];?> <?php echo $_POST["CD_mid-initial"];?> <?php echo $_POST["CD_surname"];?></div></td>
                          </tr>
                          <tr>
                            <td valign="top" style="padding-right:12px;"><div align="right" style="color:#999;">Address</div></td>
                            <td valign="top" style="font-size:13px; color:#333;"><div align="left"> <?php echo $_POST["CD_address-L1"];?> <br />
                              <?php echo $_POST["CD_address-L2"];?> <br />
                              <?php echo $_POST["CD_address-settlement"];?><br />
                              <?php echo $_POST["CD_address-county"];?><br />
                              <?php echo $_POST["CD_address-post-code"];?><br />
                              <?php echo $_POST["CD_address-country"];?></div></td>
                          </tr>
                        </table>
                      </div></td>
                      <td width="50%" valign="top"><div align="right" class="Text_normal">
                        <table width="230" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="77" valign="top" style="padding-right:12px;"><div align="right" style="color:#999;">Date of Birth</div></td>
                            <td width="153" valign="top" style="font-size:13px; line-height:22px; color:#333;"><div align="left"> <?php echo $_POST["CD_DOB-day"];?>/<?php echo $_POST["CD_DOB-month"];?>/<?php echo $_POST["CD_DOB-year"];?></div></td>
                          </tr>
                          <tr>
                            <td valign="top" style="padding-right:12px;"><div align="right" style="color:#999;">Email</div></td>
                            <td valign="top" style="font-size:13px; line-height:22px; color:#333;"><div align="left"> <?php echo $_POST["CD_email"];?></div></td>
                          </tr>
                          <tr>
                            <td valign="top" style="padding-right:12px;"><div align="right" style="color:#999;">Telephone</div></td>
                            <td valign="top" style="font-size:13px; line-height:22px; color:#333;"><div align="left"> <?php echo $_POST["CD_telephone"];?></div></td>
                          </tr>
                        </table>
                      </div></td>
                    </tr>
                  </table></td>
                  <td class="Corner-Box-WhiteGrey-R" width="6"></td>
                </tr>
                <tr>
                  <td class="Corner-Box-WhiteGrey-BL" height="6" width="6"></td>
                  <td class="Corner-Box-WhiteGrey-B" height="6"></td>
                  <td class="Corner-Box-WhiteGrey-BR" height="6" width="6"></td>
                </tr>
              </table>
            </div></td>
            <td width="255" valign="top"><div align="right">
              <table width="250" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td class="Corner-Box-WhiteGrey-TL" height="6" width="6"></td>
                  <td class="Corner-Box-WhiteGrey-T" height="6"></td>
                  <td class="Corner-Box-WhiteGrey-TR" height="6" width="6"></td>
                </tr>
                <tr>
                  <td class="Corner-Box-WhiteGrey-L" width="6"></td>
                  <td><div align="center" class="Text_normal">
                    <table width="230" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td valign="top" style="padding-right:12px;"><div align="left" style="color:#999;">Highest Current Qualifiacation</div></td>
                      </tr>
                      <tr>
                        <td valign="top" style="font-size:13px; line-height:22px; color:#333;"><div align="left"> <?php echo $_POST["CD_experience-qualifications"];?></div></td>
                      </tr>
                      <tr>
                        <td width="230" valign="top" style="padding-right:12px; padding-top:5px;"><div align="left" style="color:#999;">Total Logged Dives to Date</div></td>
                      </tr>
                      <tr>
                        <td valign="top" style="font-size:13px; line-height:22px; color:#333;"><div align="left"> <?php echo $_POST["CD_experience-dives"];?></div></td>
                      </tr>
                    </table>
                  </div></td>
                  <td class="Corner-Box-WhiteGrey-R" width="6"></td>
                </tr>
                <tr>
                  <td class="Corner-Box-WhiteGrey-BL" height="6" width="6"></td>
                  <td class="Corner-Box-WhiteGrey-B" height="6"></td>
                  <td class="Corner-Box-WhiteGrey-BR" height="6" width="6"></td>
                </tr>
              </table>
            </div></td>
          </tr>
        </table>
      </div></td>
    </tr>
  </table>
  <br />
  <table width="775" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><table width="775" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="18" height="30" style="background:url(../../../IMAGES_A/Structure/Headers/blue-corner-piece-left-30px.gif); background-repeat:no-repeat;">&nbsp;</td>
          <td bgcolor="#263D51" style="border-left:1px solid #FFF; border-right:1px solid #FFF; padding-left:5px;"><div align="left" class="Text_normal" style="font-size:13px; color:#FFF;">Details</div></td>
          <td width="18" height="30" style="background:url(../../../IMAGES_A/Structure/Headers/blue-corner-piece-right-30px.gif); background-repeat:no-repeat;">&nbsp;</td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td style="padding-top:10px;"><div align="center">
        <table width="755" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="575"><div align="left" class="Text_normal">
              <table width="565" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td class="Corner-Box-WhiteGrey-TL" height="6" width="6"></td>
                  <td class="Corner-Box-WhiteGrey-T" height="6"></td>
                  <td class="Corner-Box-WhiteGrey-TR" height="6" width="6"></td>
                </tr>
                <tr>
                  <td class="Corner-Box-WhiteGrey-L" width="6"></td>
                  <td width="553"><table width="553" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td width="428" valign="top" style="padding-bottom:3px; border-bottom:1px solid #CCC;"><div align="left" class="Text_Sub_Title"><?php echo $_POST["programme"];?></div></td>
                      <td width="125" valign="top" style="padding-bottom:3px; border-bottom:1px solid #CCC;"><div align="right" class="Text_Sub_Title" style="color:#333;">£<?php echo $_POST["Prog_total"];?></div></td>
                    </tr>
                    <tr>
                      <td colspan="2" valign="top" style="padding-top:3px;"><ul>
                        <div><?php echo $_POST["Prog_Sum_Sub_Open_Water_01_0"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Open_Water_01_1"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Refresh_01_0"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Refresh_01_1"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Advanced_01_0"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Dives_01_0"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Dive_Safari_01_0"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Dive_Safari_01_1"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Dive_Specialities_01_0"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Dive_Specialities_01_1"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Dive_Specialities_01_2"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Dive_Specialities_01_3"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Dive_Specialities_01_4"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Dive_Specialities_01_5"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Dive_Specialities_01_6"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Dive_Specialities_01_7"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Discover_Safari_01_0"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Discover_Safari_01_1"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Equipment_01_0"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Accommodation_01_0"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Accommodation_01_1"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Accommodation_01_2"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Accommodation_01_3"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_PADI_Materials_Fees_01_0"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_PADI_Materials_Fees_01_1"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Transfers_01_0"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Transfers_01_1"];?></div>
                        <div><?php echo $_POST["Prog_Sum_Sub_Transfers_01_2"];?></div>
                      </ul></td>
                    </tr>
                  </table></td>
                  <td class="Corner-Box-WhiteGrey-R" width="6"></td>
                </tr>
                <tr>
                  <td class="Corner-Box-WhiteGrey-BL" height="6" width="6"></td>
                  <td class="Corner-Box-WhiteGrey-B" height="6"></td>
                  <td class="Corner-Box-WhiteGrey-BR" height="6" width="6"></td>
                </tr>
              </table>
              <br />
              <table width="565" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td class="Corner-Box-WhiteGrey-TL" height="6" width="6"></td>
                  <td class="Corner-Box-WhiteGrey-T" height="6"></td>
                  <td class="Corner-Box-WhiteGrey-TR" height="6" width="6"></td>
                </tr>
                <tr>
                  <td class="Corner-Box-WhiteGrey-L" width="6"></td>
                  <td width="553"><table width="553" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td width="428" valign="top"><div align="left" class="Text_Sub_Title"><?php echo $_POST["Store_Dive_The_Gap_Equipment_Package"];?></div></td>
                      <td width="125" valign="top"><div align="right" class="Text_Sub_Title" style="color:#333;"><?php echo $_POST["Store_Dive_The_Gap_Equipment_Package_total"];?></div></td>
                    </tr>
                    <tr>
                      <td colspan="2" valign="top" style="padding-top:3px;"><ul>
                        <div>
                          <div><?php echo $_POST["Store_Dive_The_Gap_Equipment_Package_details"];?></div>
                        </div>
                      </ul></td>
                    </tr>
                  </table></td>
                  <td class="Corner-Box-WhiteGrey-R" width="6"></td>
                </tr>
                <tr>
                  <td class="Corner-Box-WhiteGrey-BL" height="6" width="6"></td>
                  <td class="Corner-Box-WhiteGrey-B" height="6"></td>
                  <td class="Corner-Box-WhiteGrey-BR" height="6" width="6"></td>
                </tr>
              </table>
            </div></td>
            <td width="180" valign="top"><div align="right">
              <table width="170" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td height="6" colspan="3" valign="middle" class="Text_normal" style="background:url(../../../IMAGES_A/Structure/Headers/blue-Semicircle-170px.jpg); height:25px;"><div align="left" style="padding-left:20px; padding-top:4px; color:#FFF; font-size:13px; font-weight:bold;">Summary</div></td>
                </tr>
                <tr>
                  <td class="Corner-Box-WhiteGrey-L" width="6"></td>
                  <td width="158" bgcolor="#FFF"><div align="center" class="Text_normal" style="font-size:18px; color:#333; padding-top:12px; padding-bottom:12px; border-bottom:1px solid #CCC;">£<?php echo $_POST["Basket_Total"];?><span style="font-size:13px; color:#666; padding-left:4px;">incl. VAT</span></div>
                    <div align="center" class="Text_normal" style="font-size:12px; color:#666; padding-top:12px; padding-bottom:12px;"> <?php echo $_POST["Basket-Total-Duration-Text"];?><br />
                      <span style="font-size:10px; color:#666; padding-left:4px;">incl. arrival and departure day</span></div></td>
                  <td class="Corner-Box-WhiteGrey-R" width="6"></td>
                </tr>
                <tr>
                  <td class="Corner-Box-WhiteGrey-BL" height="6" width="6"></td>
                  <td class="Corner-Box-WhiteGrey-B" height="6"></td>
                  <td class="Corner-Box-WhiteGrey-BR" height="6" width="6"></td>
                </tr>
              </table>
              <br />
              <table width="170" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td height="6" colspan="3" valign="middle" class="Text_normal" style="background:url(../../../IMAGES_A/Structure/Headers/blue-Semicircle-170px.jpg); height:25px;"><div align="left" style="padding-left:20px; padding-top:4px; color:#FFF; font-size:13px; font-weight:bold;">Start Date</div></td>
                </tr>
                <tr>
                  <td class="Corner-Box-WhiteGrey-L" width="6"></td>
                  <td width="158" bgcolor="#FFF"><div align="left" class="Text_basic" style="padding-top:12px; padding-bottom:12px;">
                    <div align="center"><span style="font-size:14px; color:#666; padding-left:10px;" align="left" id="Prog-Start-Date-Text"></span><span class="Text_normal" style="font-size:12px; color:#666; padding-top:12px; padding-bottom:12px;"><?php echo $_POST["Prog_start-date"];?></span></div>
                  </div></td>
                  <td class="Corner-Box-WhiteGrey-R" width="6"></td>
                </tr>
                <tr>
                  <td class="Corner-Box-WhiteGrey-BL" height="6" width="6"></td>
                  <td class="Corner-Box-WhiteGrey-B" height="6"></td>
                  <td class="Corner-Box-WhiteGrey-BR" height="6" width="6"></td>
                </tr>
              </table>
            </div></td>
          </tr>
        </table>
      </div></td>
    </tr>
  </table>
  <br />
</div>
</body>
</html>

2 Cevap

Sen HTML "booking_quote" değil, "rezervasyon-teklif" olarak div id var. Eğer her yerde "rezervasyon-teklif" kullandığınızdan emin olun. Eğer JavaScript kodu eklemek vermedi bu yana, neler olup bittiğini görmek zor, ama kolay bir şey olurdu

  1. Sayfanızda bir form etiketi koydu. O "my-form" ya da her neyse bir id verin.
  2. Lütfen form göndermek yöntemine bir olay eklemek
  3. yönteminde, div içeriğini almak ve gizli bir form alanı içine koydu

jQuery, bu gibi bir şey olurdu kullanma:

$('form#my-form').submit(function()
{
  $('input#my-hidden-field').val($('div#booking-quote').text())
});

Eğer magic quotes PHP kurulumunda açık var gibi geliyor. Senin $ mesaj değişkeni kaydırma deneyin stripslashes.