Lanka Developers Community

    Lanka Developers

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Shop

    contact form

    Web Development
    webdesign
    4
    6
    1064
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sumiyuru Web Development last edited by

      Html ෆෝම් එක php වලට දාලා fill කලාම මැසේජ් එකක් එන විදියට හැදුවා. ඒක echo use karala true නන් successful..! Thanks කියලා හැදුවා. False nam error කියලා හැදුවා. මේ මැසේජ් එක එන් නැතුව වෙන තැන්ක්‍යූ පේජ් එකකට ෆෝවර්ඩ් කරන්නේ කෝමද ෆිල් කරලා සක්සස් උනොත් විතරක්


      <?php
      if(isset($_POST['email'])){

      $name =$_POST["name"];
      $from =$_POST["email"];
      $subject=$_POST["subject"];
      $comment=$_POST["comment"];
      
      // Email Receiver Address
      $receiver="[email protected]";
      $subject="Contact form details";
      
      $message = "
      <html>
      <head>
      <title>HTML email</title>
      </head>
      <body>
      <table width='50%' border='0' align='center' cellpadding='0' cellspacing='0'>
      <tr>
      <td colspan='2' align='center' valign='top'><img style=' margin-top: 15px; ' src='/images/logo-mail.png' ></td>
      </tr>
      <tr>
      <td width='50%' align='right'>&nbsp;</td>
      <td align='left'>&nbsp;</td>
      </tr>
      <tr>
      <td align='right' valign='top' style='border-top:1px solid #dfdfdf; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000; padding:7px 5px 7px 0;'>Name:</td>
      <td align='left' valign='top' style='border-top:1px solid #dfdfdf; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000; padding:7px 0 7px 5px;'>".$name."</td>
      </tr>
      <tr>
      <td align='right' valign='top' style='border-top:1px solid #dfdfdf; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000; padding:7px 5px 7px 0;'>Email:</td>
      <td align='left' valign='top' style='border-top:1px solid #dfdfdf; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000; padding:7px 0 7px 5px;'>".$from."</td>
      </tr>
      	<tr>
      <td align='right' valign='top' style='border-top:1px solid #dfdfdf; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000; padding:7px 5px 7px 0;'>Subject:</td>
      <td align='left' valign='top' style='border-top:1px solid #dfdfdf; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000; padding:7px 0 7px 5px;'>".$subject."</td>
      </tr>
      <tr>
      <td align='right' valign='top' style='border-top:1px solid #dfdfdf; border-bottom:1px solid #dfdfdf; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000; padding:7px 5px 7px 0;'>Message:</td>
      <td align='left' valign='top' style='border-top:1px solid #dfdfdf; border-bottom:1px solid #dfdfdf; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#000; padding:7px 0 7px 5px;'>".nl2br($comment)."</td>
      </tr>
      </table>
      </body>
      </html>
      ";
      

      // Always set content-type when sending HTML email
      $headers = "MIME-Version: 1.0" . "\r\n";
      $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
      // More headers
      $headers .= 'From: <'.$from.'>' . "\r\n";
      if(mail($receiver,$subject,$message,$headers))
      {
      //Success Message
      echo "The message has been sent!";
      }
      else
      {
      //Fail Message
      echo "The message could not been sent!";
      }

      }
      ?>

      1 Reply Last reply Reply Quote 1
      • Nubelle
        Nubelle Web Development last edited by

        you can use like this header('Location: http://www.example.com/'); mchan style karanakota inline gahan nathiwa wena css file ekak maintain karanam hodai ;
        :)

        1 Reply Last reply Reply Quote 2
        • S
          sumiyuru Web Development last edited by

          Thanks 😘😍

          Nubelle 1 Reply Last reply Reply Quote 0
          • Nubelle
            Nubelle Web Development @sumiyuru last edited by

            @sumiyuru elzz

            1 Reply Last reply Reply Quote 0
            • Sahan Pasindu Nirmal
              Sahan Pasindu Nirmal Web Development last edited by

              header('Location: http://www.example.com/'); මේ function එක use කරන්න. තව කියවන්න මෙතනින්. https://www.w3schools.com/php/func_http_header.asp

              1 Reply Last reply Reply Quote 0
              • Manoj Abewardhana
                Manoj Abewardhana last edited by

                js location.href
                use this

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post

                1
                Online

                3.7k
                Users

                1.3k
                Topics

                5.3k
                Posts

                • Privacy
                • Terms & Conditions
                • Donate

                © Copyrights and All right reserved Lanka Developers Community

                Powered by Axis Technologies (PVT) Ltd

                Made with in Sri Lanka

                | |