PHP file Download Script
This article represent you how to download any files from php web server to local machine. This application works mainly on the header of the PHP. Demo: <?php $file = ‘monkey.gif’; if (file_exists($file)) { header(‘Content-Description: File Transfer’); header(‘Content-Type: application/octet-stream’); header(‘Content-Disposition: attachment; filename=’.basename($file)); header(‘Content-Transfer-Encoding: binary’); header(‘Expires: 0’); header(‘Cache-Control: must-revalidate’); header(‘Pragma: public’); header(‘Content-Length: ‘ . filesize($file)); ob_clean(); […]
How to restart nginx?
For Restart nginx server /etc/init.d/nginx restart will restart nginx as will service nginx restart
Install Send Mail Function in nginx Server ubuntu
First of all check send mail function is install in to that server to check that Please execute this command in termianal vds@vps:/etc$ netstat -ntpl You Found result like this (No info could be read for “-p”: geteuid()=1000 but you should be root.)Active Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program […]
Send Mail in php
Description bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] ) Using mail() to send a simple email: <?php// The message$message = “Line 1rnLine 2rnLine 3”;// In case any of our lines are larger than 70 characters, we should use wordwrap()$message = wordwrap($message, 70, “rn”);// Sendmail(‘caffeinated@example.com’, ‘My Subject’, $message);?>
Magento How to link to category by id from static block/page
{{widget type=”catalog/category_widget_link” anchor_text=”Displayed Text” title=”Title attribute text” template=”catalog/category/widget/link/link_block.phtml” id_path=”category/22″}}
install filezilla in ubuntu
Install FileZilla on Ubuntu 11.04 To install FileZilla open Termina sudo add-apt-repository ppa:ferramroberto/filezillasudo apt-get updatesudo apt-get install filezilla Here is the Homepage of FileZilla.
magento change the number of products per row
<reference name=”product_list”> <action method=”setColumnCount”><columns>4</columns></action></reference>
Debug Magento Code
For Debug we have to use Zend_Debug::dump() function. Here is Example; Zend_Debug::dump( Mage::getModel(‘Catalog/Product’) );
How To Reset Your Password
First, open up phpMyAdmin. Click on your database name for Magento from the sidebar on the left. Click on the SQL tab and type the following in to the text box: UPDATE `admin_user` SET `password` = MD5(‘123456’) WHERE `username` = ‘admin’;