Thursday, May 20, 2010

<style>
html, body {
height: 100%;
}
#container {
min-height: 100%;
margin-bottom: -80px;
position: relative;
}
#footer {
height: 80px;
position: relative;
}
.clearfooter {
height: 80px;
clear: both;
}
</style>

<html>
<body>
<div id="container">
<div id="header">Header</div>
<div id="nav">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Page 1</a></li>
<li><a href="#">Page 2</a></li>
</ul>
</div>
<div id="content">Content Here.</div>

<div class="clearfooter"></div>

</div><!--End Container-->

<div id="footer">Footer Here.</div>
</body>
</html>

Stay footer always bottom








Content Here.








Tuesday, March 9, 2010

Play WMV in Browser

1) Replace "http://www.example.com/myfile.wmv" with your file name.
2) Replace "[" with "<"
3) Replace "]" with ">"


[object id="MediaPlayer" width=640 height=480 classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player components..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"]
[param name="filename" value="http://www.example.com/myfile.wmv"]
[param name="Showcontrols" value="True"]
[param name="autoStart" value="FALSE"]
[embed type="application/x-mplayer2" src="http://www.example.com/myfile.wmv" width=640 height=480][/embed]
[/object]

Enjoy the code

Tuesday, February 9, 2010

One to Many Relation in RDBMS single SQL to fetch data

Many times we need a single sql that fetch the data from one to many relation ship.
in mysql database we can achive this with the help of OUTER JOIN.

let say employee table having the record with emp_id and each employee have multiple contact number in table emp_contact so we fetch the record in single sql employee with there contact list.

SELECT
emp.*,
con.contact_number_list
FROM
emp
LEFT OUTER JOIN (
SELECT emp_id, GROUP_CONCAT( CAST(contact_num as CHAR ) ) as contact_number_list
FROM emp_contact
GROUP BY emp_id
) AS con ON con.emp_id = emp.emp_id

Tuesday, January 19, 2010

Magento after installtion can not able to login

Solution:
I googled and found these solutions:-

a) Use 127.0.0.1 instead of localhost in your url, i.e. using http://127.0.0.1/magento/index.php/admin instead of http://localhost/magento/index.php/admin . But this didn’t solve my problem.

b) Since I am using Linux, I was suggested to open "hosts" file from /etc/hosts and have 127.0.0.1 point to something like magento.localhost or even 127.0.0.1 point to http://www.localhost.com.
But this option i not tested.

c) This solution finally helped me out of this problem. The solution was to modify the core Magento code. Open app/code/core/Mage/Core/Model/Session/Abstract/Varien.php.
Comment out the lines 80 to 83. The line number may vary according to the Magento version. But these lines are present somewhere near line 80. You have to comment the comma (,) in line: $this->getCookie()->getPath()//,

// set session cookie params
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath()//,
//$this->getCookie()->getDomain(),
//$this->getCookie()->isSecure(),
//$this->getCookie()->getHttponly()
);

Magento installtion Deprecated error for php5.3

Deprecated errors

a) split is deprecated.

to override these issue please make following changes of reporting error
y:\magento\index.php in these file replace error_reporting with following one
error_reporting(E_ALL & E_STRICT & ~E_DEPRECATED);

y:\magento\downloader\Maged\Pear.php in these file replace error_reporting with following one
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);

y:\magento\lib\Varien\Pear.php in these file replace error_reporting with following one
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);

Saturday, January 16, 2010

Magento not working on PHP 5.3

Fatal error: Method Varien_Object::__tostring() cannot take arguments in /magento/lib/Varien/Object.php
Change 1) /lib/Varien/Object.php (Line 484)
Change from
public function ___toString(array $arrAttributes = array(), $valueSeparator=’,')
To this
public function __invoke(array $arrAttributes = array(), $valueSeparator=’,')
Change 2) File /app/code/core/Mage/Core/Controller/Request/Http.php (Line 274)
Change from
$host = split(‘:’, $_SERVER['HTTP_HOST']);
To this
$host = explode(‘:’, $_SERVER['HTTP_HOST']);