August 25, 2012

How to send Multiple Emails in PHP


include("../connect.php");
if(isset($_REQUEST['Send']))
{
foreach ($_POST['chk_box'] as $id)
{
      $qr = mysql_query("SELECT email FROM <Table Name> WHERE id = '".$id."' ");
      if (mysql_affected_rows()>0)
{
while ($email = mysql_fetch_array($qr))
{
            $email_add = $email['email'];
 mail( $email_add , 'Subject','Message Goes Here', "From: <Your Email Address>");
}
}
}
}

August 4, 2012

display image preview before it upload using PHP and JavaScript


Put this code between <head>...</head> tag.

<script type="text/javascript">
   function readURL(input) {
    if (input.files && input.files[0]) {
        var reader = new FileReader();
        reader.onload = function (e) {
        $('#test').attr('src', e.target.result);
       }
        reader.readAsDataURL(input.files[0]);
       }
    }
</script>

Put this code in main body.

<form id="form1" runat="server">
<input onchange="readURL(this);" type="file" />
      <img alt="Image Display Here" id="test" src="#" />
  </form>

Enjoy :

Integrating Google reCAPTCHA v3 in HTML Form with PHP

  What is Google reCAPTCHA v3? Google reCAPTCHA is a free service that helps protect websites from spam and abuse. reCAPTCHA v3 is the lates...