Friday, March 26, 2010

How to install Magento in Window with Wamp

After three long days, Today I have successfully installed magento in my local P.C. To install magento its not an easy task. Actually magento is develop for Linux server. So install in window XP We have to make some changes into php.ini file.

Magento is not supported with php 5.3 so keep in mind not to use latest WampServer2.0i, download WampServer2.0h from
Magento latest version4.0.1 is not supported for Wamp, so download magento version 1.3.2.4 from http://www.magentocommerce.com/download

After successfully download magento unzip folder and put it into your wamp folder for example mine is D:/wamp/magento.

To install magento follow this steps....

1. Changes into Apache/config/httpd.config file.
  • #LoadModule rewrite_module modules/mod_rewrite.so
  • just remove # and you get
  • LoadModule rewrite_module modules/mod_rewrite.so.
2. Edit apache\bin\php.ini file.
  • #extension=php_curl.dll
  • #extension=php_soap.dll
  • #extension=php_mcrypt.dll
  • just remove # from these lines.
Now create the database name magento (which I used) and open the browser with http://localhost/magento
You will get page like


just click on agree button you get a new page like this

Here you can change your localized setting or by-default click on next button then you will get the following screen.


Please check your database name, User name and Password. and then click on next button you will get the admin page to create an account.


Fill up your admin detail like username and password as your choice. click on next button.
Now magento is ready. and you will get this screen.


Enjoy...

If you are facing problem regarding admin login just comment this line
go for magento\app\code\core\Mage\Core\Model\Session\Abstract\varien.php

go to line no 78, you get this code and comment line no 81 to 83

session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath()
/*$this->getCookie()->getDomain(),
$this->getCookie()->isSecure(),
$this->getCookie()->getHttponly()*/
);

Monday, October 19, 2009

Bith date validation with javascript

Hello All,

In one of my project I have to enter birth date.
BirthDateValidation function validates the BirthDate based on two conditions.

  1. The date should be less than or equal to the current date
  2. The date should be greater than current date and the difference between the current date and the date 100 years back.
So, right down the following code in your java script.
function BirthDateValidation()
{
var val=document.getElementById('birthdate').value;
var splits = val.split("/");
var dt = new Date(splits[1] + "/" + splits[0] + "/" + splits[2]);
var dtToday = new Date();
var pastDate = new Date(Date.parse(dtToday.getMonth()+"/"+dtToday.getDate()+"/"+parseInt(dtToday.getFullYear()-100)));
if (dt < pastDate || dt >= dtToday) {
alert("Birth Date can not be greatear than current Date"); }
else {
alert("valid BirthDate"); }
}

Write your Html code.
form name="validation" id="validation" method="post"
input name="birthdate" id="birthdate" type="text"
input name="btnsubmit" onClick="BirthDateValidation();" type="submit"
(formate dd/mm/yyyy

Simple you will get the right birth date. Better use calender instead of write birth date in textbox directly.

Tuesday, July 22, 2008

Write store procedure in mysql

Hello friends,
I handed over when use store procedure in one of my project in php with use of MySQL.
MySQL 5 is support store procedure. you must use the sqlyog for this functionality.
select one of the database. For example my database name is "project"

create table
CREATE TABLE `users` (
`u_id` int(11) NOT NULL auto_increment,
`u_fname` varchar(255) NOT NULL,
`u_email` varchar(255) NOT NULL,
`user` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`u_add` varchar(255) NOT NULL,
`u_phone` varchar(255) NOT NULL,
`u_active` enum('0','1') NOT NULL default '0',
PRIMARY KEY (`u_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;

Now for create new procedure right click on "store procedure" enter the name of your new procedure sp_insert

DELIMITER $$
DROP PROCEDURE IF EXISTS `project`.`sp_insert`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_insert`(id int , ufname varchar(255),uemail varchar(255),uuser varchar(255),
upswd varchar(255),uadd varchar(255),uphone varchar(255),uactive enum('0','1'))
BEGIN
insert into users values('',ufname,uemail,uuser,upswd,uadd,uphone,uactive);
END$$
DELIMITER ;

press F5 for run your procedure you will get the message "create successfully" or (0 rows affected).

Next step go to the query tab and write
call sp_insert('null','test','test@gmail.com','test','testing123',
'xxx','123-768','0');
That's all end you will get the result.

Sunday, June 8, 2008

Only enter integer value in textbox with javascript

Here the code how its work
create one php file as numberonly.php

write function into your javascript file
function isNumberKey(evt) { var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode <> 57))
return false;
return true; }

put this function into textbox onkeypress event.
input type=text onkeypress=return isNumberKey(this.value)
Enjoy.. you will get the result.

Friday, April 25, 2008

Jayu shah's Blog

Hi

My name is jayu shah. I am php developer. My blog is related to Information technology.
Key skills php, mysql, Ajax, javascript.