Pages

Tuesday, October 15, 2013

How to solve Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2006 MySQL server has gone in Drupal 7?

This issue will come generally because of allocation of memory in mysql, to over come this just run the below query in mysql server.

mysql> SET max_allowed_packet = 1024 * 1024 * 512;
 
 or  
 
mysql> SET global max_allowed_packet=1024 * 1024 * 512; 

Wednesday, May 15, 2013

how to do form validation using php,json?

Download the below code....

https://docs.google.com/file/d/0B_lKxr7C6K3zRHBPWmhHVFUzT1E/edit?usp=sharing

or
<html>
<head>
<title>JQuery Form Validation</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script>
<script type="text/javascript">
 $(document).ready(function(){
  $("#form1").validate({
         debug: false,
   rules: {
    name: "required",
    dropdown: "required",
    email: {
     required: true,
     email: true
    }
   },
   messages: {
    name: "Please enter your good name.",
    email: "Please enter your valid email address.",
    dropdown: "Please select option from dropdown list.",
   },
   submitHandler: function(form) {
 
    $.post('nextstep.php', $("#form1").serialize(), function(data) {
     $('#result').html(data);
    });
   }
  });
 });
</script>
<style>
 label.error { width: 250px; display: inline; color: red;}
</style>
</head>
<body>
<form name="form1" id="form1" action="" method="POST">
    <label for="name" id="name_label">Name</label>
    <input type="text" name="name" id="name" size="30" value=""/>
 <br>
    <label for="email" id="email_label">Email</label>
    <input type="text" name="email" id="email" size="30" value=""/>
<br>
 Please Select the City:
<select name="dropdown" id="dropdown">
<option value="">None</option>
<option value="mumbai">Mumbai</option>
<option value="delhi">Delhi</option>
<option value="pune">Pune</option>
</select>
 <br>
 <input type="submit" name="submit" value="Submit">
</form>
<!-- We will output the results from process.php here -->
<div id="result"><div>
</body>
</html>

or
http://www.webreference.com/programming/javascript/jquery/form_validation/index.html

http://www.tutorialswitch.com/web-development/quick-and-simple-ajax-forms-with-json-responses/

Monday, April 1, 2013

How to solve 404 page not found error when SEO urls used or SEO url 404 error?

1. check in admin panel whether you are activated Use SEO URL's to Yes or not.

 Goto admin panel system->settings-> Server

Then check  Use SEO URL's to Yes.

Friday, March 8, 2013

How to Solve Notice: Undefined index: highlighted in include() in drupal 7?

To solve this error/notice need to follow below steps.

1. If you have created any block or region need to check the block/region name in .info file of the theme. For example i have created on block/region like..

Wednesday, March 6, 2013

how to add/create a new block in drupal?

To create a new block region just need to following things..
1. In .info file we need to add block name like..
     regions[sidebar_second] = Sidebar Second
2. Then goto template page and add the below code wherever you want add the block of region.
    <div id="right1" class="clearfix">
            <?php print render($page['sidebar_second']); ?>
     </div>
Note: need to give div id unique

Monday, February 25, 2013

how to change title in mail for wordpress website from wordpress to customized text?

Todo this just goto page..
/wp-includes/pluggable.php

Search $from_name = 'WordPress'; and  Replace Wordpress word with
$from_name = 'your own name';

Tuesday, February 5, 2013

How to display total blog posts in a static page?

To display total blog posts in a static page which are created by the developer, need to follow below steps..

1. Create a page with the name posts.php in theme folder which the site using.
2. Copy paste below code

<?php
/**
 * Template Name: Posts Page
 * Description: A Page Template that adds a sidebar to pages
 *
 * @package WordPress
 * @subpackage Twenty_Eleven

Thursday, January 31, 2013

How to Add CKEditor in Drupal

Following Steps need to follow.

First Download 3 file.

  1. Download CKEditor module(ex.ckeditor 7.x-1.2). To download click here.
  2. Download CKEditor Software(ex.CKEditor 3.6.6) .To download click here.
  3.  Download imce Software(ex.imce-7.x-1.4.tar.gz) .To download click here 
  4. Unzip all the zip files which are downloaded. After that copy the CKEditor software folder. 
  5. Inside the CKEDitor module folder there is folder name CKEditor, paste the software folder in that folder.
  6. Now copy the CKEditor module folder and IMCE folder into the drupal project folder in sites/all/module.

How to remove Read more and display Content on front page

Just goto Configuration -> Site Information there we will find an option like "Default front page". There you can give your node id of the page what you are created.


For Ex.


I have created page which i want to make as front page like "Wel Come". When we are created the page it will take a node id a default value like "5".


So we need to add this value in Default Front Page as "node/5"

Tuesday, January 22, 2013

How to create a plugin in wordpress?

For creating a new plugin in wordpress need to follow below steps:

1. Create a php file in plugins folder of your wordpress project.

For example : mytestplugin.php

2. Add the below code in that:
 <?php
/*
Plugin Name: My Test Plugin
Plugin URI: http://google.com
Description: This is a my first plugin
Version: 1.0
Author: Kiran
Author URI: http://gmail.com/
*/
?>
Plugin Name: name of the plugin which display at admin side of wordpress in plugins menu.
Plugin URL: describes the link of your plugin site.
Description: description of the plugin.
Version: version of the plugin
Author: Name of the author who creates the plugin
Authod URL: url of the author's site.