Posts

Showing posts from September, 2014

Dropdown Menu in Css and Html

DROPDOWN MENU IN CSS AND HTML HTML <ul id="menu">                 <li><a href="#">Mobile</a>                                    <ul class="submenu">                                        <li><a href="#">sony</a></li>                     <li><a href="#">apple</a></li>                     <li><a href="#">micromax</a></li>                     </ul>                                    </li>                 <li class="tablet"><a href="#">tablet</a></li>                                               <li class="accessries"><a href="#">accessries</a></li>                                   </ul> CSS ul#menu,ul#menu ul.submenu{ margin:0; padding:0; } ul#menu li,ul#menu ul.submenu li { list-style-

Register and Display Widget Area In Wordpress

Image
<?php /** * Register Widget Area. * */ function wpgyan_widgets_init ( ) {      register_sidebar ( array (          'name' = > 'Header Sidebar' ,          'id' = > 'header_sidebar' ,          'before_widget' = > '<div>' ,          'after_widget' = > '</div>' ,          'before_title' = > '<h2 class="rounded">' ,          'after_title' = > '</h2>' ,      ) ) ; } add_action ( 'widgets_init' , 'wpgyan_widgets_init' ) ; ?> Paste this code into your theme's functions.php file. Now you could see widget area into site backend navigating Appearance -> Widgets. . Now you could place Widgets on this widget area using available widgets. DISPLAY WIDGET AREA Once you have added content. Now you could show this widget area on required position in theme

Write Excel file using PHP and MYSQL Records

GENERATE EXCEL FILE USING PHP AND MYSQL Here is the following code to generate excel file. <?php $dbhost= "Mysql server name"; //your MySQL Server $dbuser = "Username"; //your MySQL User Name $dbpass = "password"; //your MySQL Password $dbname = "database name"; //your MySQL Database Name of which database to use this $tablename = "table"; //your MySQL Table Name which one you have to create excel file // your mysql query here , we can edit this for your requirement $sql = "Select * from $tablename "; //create  code for connecting to mysql $Connect = @mysql_connect($dbhost, $dbuser, $dbpass) or die("Couldn't connect to MySQL:<br>" . mysql_error() . "<br>" . mysql_errno()); //select database $Db = @mysql_select_db($dbname, $Connect) or die("Couldn't select database:<br>" . mysql_error(). "<br>" . mysql_errno()); //execute query $resu