Thursday, 2 May 2013

Php Email with Attachment

<?php
if($_POST['frm']==1)
    {   
    $upload_folder="uploadfiles/";
    $filename1=$_FILES['logo1']['name'];
    $filename2=$_FILES['logo2']['name'];
    $type1=substr($filename1,strrpos($filename1, '.') + 1);
    $type2=substr($filename2,strrpos($filename2, '.') + 1);
    $size1=$_FILES["your_id"]["size"]/1024;
    $size2=$_FILES["picture_holding_id"]["size"]/1024;
    $max_allowed_file_size = 100;
    $allowed_extensions = array("jpg", "jpeg", "gif", "bmp");
    /* if($size1>0)
    {
        if($size1> $max_allowed_file_size )
        {
        $err[]= "\n Size of file should be less than $max_allowed_file_size";
        }
    }
    if($size2>0)
    {
        if($size2> $max_allowed_file_size )
        {
        $err[]= "\n Size of file should be less than $max_allowed_file_size";
        }
    }
    $allowed_ext = false;
    if($size1>0)
    {
        for($i=0; $i<sizeof($allowed_extensions); $i++)
        {
        if(strcasecmp($allowed_extensions[$i],$type1) == 0)
          $allowed_ext = true;
        }
    }
    if($size2>0)
    {
        for($i=0; $i<sizeof($allowed_extensions); $i++)
        {
        if(strcasecmp($allowed_extensions[$i],$type2) == 0)
            $allowed_ext = true;
        }
    }
    if($size1>0 || $size2>0)
    {
        if(!$allowed_ext)
        {
            $err[]= "\n the uploaded file is not supported file type.

    only the following file types are supported: ".implode(',',$allowed_extensions);
        }
    } */

    $path_of_uploaded_file1 = $upload_folder . $filename1;
    $path_of_uploaded_file2 = $upload_folder . $filename2;
    $tmp_path1 = $_FILES["logo1"]["tmp_name"];
    $tmp_path2 = $_FILES["logo2"]["tmp_name"];
    /* if(is_uploaded_file($tmp_path1))
    {
        if(!copy($tmp_path1,$path_of_uploaded_file1))
        {
            $err[]= '\n error while copying the uploaded file';
        }
    }
    if(is_uploaded_file($tmp_path2))
    {
        if(!copy($tmp_path2,$path_of_uploaded_file2))
        {
            $err[]= '\n error while copying the uploaded file';
        }
    } */
    $files = array($path_of_uploaded_file1,$path_of_uploaded_file2);
    $to="kishanlal.laxkar@dotsquares.com";
    $subject="Host Update Form";

    $headers = 'From: abc@xyz.com';
    $message="Hello This is an attachment mail\n";
    $semi_rand = md5(time());
    $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";

    $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" .

     " boundary=\"{$mime_boundary}\"";

    $message = "This is a multi-part message in MIME format.\n\n" .

    "--{$mime_boundary}\n" . "Content-Type: text/plain; charset=\"iso-8859-1\"\n" .

    "Content-Transfer-Encoding: 7bit\n\n" . $message . "\n\n";
    $message .= "--{$mime_boundary}\n";

    for($x=0;$x<count($files);$x++){
        $file = fopen($files[$x],"rb");
        $data = fread($file,filesize($files[$x]));
        fclose($file);
        $data = chunk_split(base64_encode($data));
        $message .= "Content-Type: {\"application/octet-stream\"};\n" .

            " name=\"$files[$x]\"\n" ."Content-Disposition: attachment;\n" .

            " filename=\"$files[$x]\"\n" ."Content-Transfer-Encoding: base64\n\n" .

            $data . "\n\n";
        $message .= "--{$mime_boundary}\n";
    }
    $ok = @mail($to, $subject, $message, $headers);
    if ($ok)
    {
        $err[]="mail sent to $to";
        if($path_of_uploaded_file1!="")
            unlink($path_of_uploaded_file1);
        if($path_of_uploaded_file2!="")
            unlink($path_of_uploaded_file2);
    }
    else
    {
        $err[]="mail could not be sent";
    }
}

?>
<form method="POST" name="email_form_with_php" action="" enctype="multipart/form-data">
<input type="text" name="frm" value="1" >

<label for='name'>Name: </label>
<input type="text" name="name" >

<label for='email'>Email: </label>
<input type="text" name="email" >

<label for='message'>Message:</label>
<textarea name="message"></textarea>

<label for='uploaded_file'>Select A File To Upload:</label>
<input type="file" name="logo1">
<input type="file" name="logo2">

<input type="submit" value="Submit" name='submit'>
</form>

Tuesday, 9 October 2012

how to show pinterest prodcut

<a href="http://pinterest.com/pin/create/button/?url=http%3A%2F%2F192.168.1.50%2Fabid%2FGrindz%2F&media=<?php echo  $this->helper('catalog/image')->init($_product, 'image') ; ?>" class="pin-it-button" count-layout="horizontal"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a>
<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>


<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>

Thursday, 13 September 2012

PHP Howto Read IP address of remote computer/browser

 <?
$ip= $REMOTE_ADDR;
echo "<br> Your IP address : " . GetHostByName($ip) ;
echo "<br> Your hostname : " . $_SERVER['SERVER_NAME'];
?><br />
 <?
$ip= $REMOTE_ADDR;
echo "<br> Your IP address : " . GetHostByName($ip) ;
echo "<br> Your hostname : " . $_SERVER['SERVER_NAME'];
?><br />

Important link in magento

************please select name change in drop down**********
http://stackoverflow.com/questions/5163106/change-remove-please-select-message-from-custom-option-dropdown-on-magento
************************************************************************

********************************** Custom one page checkout******************
1=http://nightlyworker.posterous.com/magento-skip-shipping-and-payment-method-step
2=http://www.magentocommerce.com/boards/viewthread/19125/
3=http://winvinod.blogspot.com/2011/06/skip-shipping-method-from-onepage.html
******************************************************************************************

***************************tab content link********************************
http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm
*****************************************************************************

**********************wishlist link************************************************************
<action method="addLink" translate="label title" module="wishlist" ifconfig="wishlist/general/active"><name>My Wishlist</name><path>wishlist/</path><label>My Wishlist</label><prepare/><urlParams/><position>30</position><li/><a>class="top-link-wishlist
s"</a></action>
********************************** window location*********************
print("<script>window.location='index.php'</script>");
*****************************************************************************************
***********************************all exention link**********************
http://visionwidget.com/inspiration/web/374-free-magento-extensions.html
********************************************************************************
********************************satic block call******************
  <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('contact_no')->toHtml(); ?>
******************************************************************************************
***********************staic block call by Xml*******************
<block type="cms/block" name="suggest_product">
        <action method="setBlockId"><block_id>bestseller</block_id></action>
    </block>
*************************************************************************************

********************************category show with image**************************
http://hridaya.com.np/display-categories-with-images-on-homepage-in-magento/
*********************************************************************************
*******************************left catgory menu************************
http://www.magentocommerce.com/magento-connect/sidebar-navigation-menu-4554.html
*******************************************************************************
**********************************particuler category show by id***************
http://stackoverflow.com/questions/5889593/magento-list-sub-categories-of-a-specific-parent-category-as-links
********************************Currency change with flag********************************
http://www.magentocommerce.com/magento-connect/magento-easy-catalog-images.html
*******************************************************************************
************************particuler category product show***************************
http://blog.magikcommerce.com/how-to-display-best-selling-products-on-magento-store-home-page/
*************************************************************************
***************************** banner extension**************************
http://www.magentocommerce.com/magento-connect/simple-banners.html
http://www.magentocommerce.com/magento-connect/multiple-banner-extension.html
http://www.magentocommerce.com/magento-connect/banner-slider-3912.html
***********************************************************************************
******************************socail link extension***************************
http://www.magentocommerce.com/magento-connect/Zizio/extension/6378/ziziogroupsale
******************************** facebook like button*******************8
http://www.magentocommerce.com/magento-connect/facebook-like-button.html
*********************************************************************
**********************order delete exention*******************
http://www.silvertouch.com/MagentoExtensions/
*********************************************************************
********************************order comment extension**********************
http://www.magentocommerce.com/magento-connect/catalog/product/view/id/10860/
*********************************************************************************
*******************************webshop martix rate***************************
http://www.magentocommerce.com/magento-connect/webshopapps-matrixrate-1-multiple-table-rates-extension-certified-bug-free.html
*****************************************************************************
*************************************best selling categoty wise*****************************************
http://www.magentocommerce.com/magento-connect/bnm-best-selling-products-new-products-and-most-viewed-products.html
http://www.magentocommerce.com/magento-connect/bestseller-selected-on-category-id.html
******************************************************************************************************
************************how to import and export category in magnto**********
http://www.bluehorse.in/amit-bera/bluehorse-stuffs/export-and-import-categories-in-magento/
http://blog.srmklive.com/2011/03/21/how-to-export-categoriessubcategories-from-x-cart-to-magento/
******************************************************************************
**********************************multiple image upload*****************
http://prattski.com/2009/10/09/magento-import-multiple-images-for-products-module/
http://www.consofas.com/blog/import-products-into-magento-with-multiple-images/
******************************************************************************
***************************how to add custom filed in one page in magento*********
http://indiestechtips.wordpress.com/2011/07/30/how-to-add-custom-field-in-the-billing-and-shipping-address-of-onepage-checkout-in-magento/
*************************************************************************8
*********************************imoprtant extension link**************
http://www.magebuzz.com/magento-extensions.html?p=2
http://www.magentocommerce.com/magento-connect/webforms-community-edition.html
************************************************************
***************************how to add custom moudlein magento*********
http://www.webspeaks.in/2010/08/create-your-first-adminbackend-module.html
**********************************************************
******************************facebook all in one*******
http://www.magentocommerce.com/magento-connect/magazento-all-in-one-facebook-widgets-integration.html
********************************************************************
**********************most view  product slider************
http://www.magentocommerce.com/magento-connect/product-slider-9077.html
**********************************************************************************
***************************select box convert ul li******************
http://stackoverflow.com/questions/6797684/convert-ul-to-select-w-optgroups
**************************************************************
*******************************category search link*******************
http://www.geekyplugins.com/magento/catalog-category-search.dot
***********************************************************************
***************************************price countdown******************
http://www.magentocommerce.com/magento-connect/price-countdown.html
********************************************************************************
************************************cart drop down extenion***********************
http://www.magentocommerce.com/magento-connect/sharplogicians-cart-drop-down-3832.html
*****************************************************************************************
******************************catalog search extension**************************
http://www.magentocommerce.com/magento-connect/catalog-search-refinement.html
*****************************************************************************************88

Tuesday, 28 August 2012

Pop up box by css


<script type="text/javascript">
function apply()
{
    if(document.getElementById("apply"))
    {
     document.getElementById("popupform").style.display="block";
    }
    else
    {
    document.getElementById("popupform").style.display="none";
    }
}
 </script>


<style type="text/css">

.blankdiv{background-color:#000;
position:fixed;
z-index: 9001;
top:0px; height:100%;
left:0px;
width:100%; opacity: 0.65;
filter:alpha(opacity=65);}

 <style type="text/css">
#popupform{
height: 100%;
left: 0;
padding: 15px;
position: fixed;
top: 0;
width:97%;
z-index: 10001;
}
  
#popupform .applyform{position:relative; overflow:auto;
background-color:#fff;
width:670px;
height:500px;  margin:5% auto auto auto;
z-index: 9002; padding:10px; border:10px solid #7F3814; }


#pclose{background-image: url("images/close.png");
    background-position: left top;
    background-repeat: no-repeat;
    cursor: pointer;
    height: 25px;
    margin: 5% auto -6%;
    position: relative;
    right: -348px;
    text-indent: -9999px;
    top: 0;
    width: 25px;
    z-index: 9999;}

  

</style>


<p>&nbsp;</p>
<div id="popupform" style="display: none;">
<div class="blankdiv">&nbsp;</div>
<div class="applyform">
<div class="pop-title">
<h3>Shipping Details</h3>
<div id="pclose" onclick="javascript:document.getElementById('popupform').style.display='none';">close</div>
</div>
<div id="contactarea">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec orci massa, elementum non euismod vitae, dictum eu augue. Suspendisse sodales, risus eu bibendum hendrerit, leo metus pharetra velit, eu pellentesque dui nunc at tortor. Integer id purus libero, nec pulvinar ipsum. Nam eu mattis neque. Morbi dignissim laoreet dui, id imperdiet dui fermentum sed. Vestibulum leo lacus, rhoncus sed faucibus quis, hendrerit vitae urna. Nulla id arcu eget elit laoreet euismod in at orci. In hac habitasse platea dictumst. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed vitae quam nisi. Integer placerat tincidunt imperdiet. Phasellus posuere ligula vel mauris commodo semper.<br/>

Quisque lacinia quam in diam molestie cursus. Quisque elit leo, mollis vitae rhoncus et, sagittis eget elit. Aenean et ipsum felis, vulputate elementum libero. Integer tellus est, viverra ac dignissim nec, gravida ut metus. In sit amet turpis sem. Nullam a orci nec sem ultricies varius. Phasellus feugiat aliquet dolor id viverra. Pellentesque id porta justo. Duis enim risus, sodales in congue quis, sollicitudin et mi.
</div>
</div>
</div>

<a href="#" onclick="javascript:document.getElementById('popupform').style.display='block';"> test</a>
<!--<img onclick="javascript:document.getElementById('popupform').style.display='block';" src="{{media url="free-fast-shipping.png"}}" alt="" />-->

Thursday, 23 August 2012

Cart Drop Down extension link in magnto

http://www.magentocommerce.com/magento-connect/sharplogicians-cart-drop-down-3832.html

Wednesday, 25 July 2012

Magento Bestseller Products Extension

1=  http://www.magentocommerce.com/magento-connect/bestseller-products-7401.html
2= http://www.magentocommerce.com/magento-connect/bestseller-selected-on-category-id.html
3= http://www.magentocommerce.com/magento-connect/bnm-best-selling-products-new-products-and-most-viewed-products.html