Magento Coding Solutions

magento user registration programmatically

$customer_email = 'test@testemail.com'; 
$customer_fname = 'test_firstname';    
$customer_lname = 'test_lastname';     
$passwordLength = 10;


$customer = Mage::getModel('customer/customer');
$customer->setWebsiteId(Mage::app()->getWebsite()->getId());
$customer->setEmail($customer_email);
$customer->setFirstname($customer_fname);
$customer->setLastname($customer_lname);
$customer->setPassword(md5());
$customer->save();

magento add product image programmatically

<?php
$productId=1;
$newProduct= Mage::getModel('catalog/product')->load($productId);

                    /*myimage*/
           
                $previewImage= Mage::getBaseDir().'/images/designs/1_0.png';
                if(file_exists($previewImage)){
                                $newProduct->setMediaGallery (array('images'=>array (), 'values'=>array ()));
                                $newProduct->addImageToMediaGallery ($previewImage, array ('thumbnail','small_image','image'), false, false);
                                }                     
                            }           
                                   
               
                $newProduct->save();
               
                ?>