Friday, 30 August 2013

date compare validation

javascript


$(document).ready(function(){
    $("#txtFromDate").datepicker({
        minDate: 0,
        maxDate: "+60D",
        numberOfMonths: 2,
        onSelect: function(selected) {
          $("#txtToDate").datepicker("option","minDate", selected)
        }
    });
    $("#txtToDate").datepicker({ 
        minDate: 0,
        maxDate:"+60D",
        numberOfMonths: 2,
        onSelect: function(selected) {
           $("#txtFromDate").datepicker("option","maxDate", selected)
        }
    });  
});
 
 
html
 
 
From: <input type="text" id="txtFromDate" />
To: <input type="text" id="txtToDate" /> 

Monday, 26 August 2013

date picker

 <script>
$(function() {
$( "#datepicker").datepicker({
numberOfMonths: 3, showCurrentAtPos: 0,minDate: 0,dateFormat: 'dd-mm-yy', showOn: "button",
buttonImage: "image/cicon.png",
buttonImageOnly: true,
showOn: 'both',
});
});
</script>

Sunday, 18 August 2013

what is the session



(1) The session of activity that a user with a unique IP address spends on a Web site during a specified period of time. The number of user sessions on a site is used in measuring the amount of traffic a Web site gets. The site administrator determines what the time frame of a user session will be (e.g., 30 minutes). If the visitor comes back to the site within that time period, it is still considered one user session because any number of visits within that 30 minutes will only count as one session. If the visitor returns to the site after the allotted time period has expired, say an hour from the initial visit, then it is counted as a separate user session.
Contrast with unique visitor, hit, click-through and page view, which are all other ways that site administrators measure the amount of traffic a Web site gets.
(2) The period of time a user interfaces with an application. The user session begins when the user accesses the application and ends when the user quits the application.

Saturday, 6 July 2013

XML TO PHPMYADMIN DATA INSERT THROUGH PHP

<?php
include_once('conf/conf.php');
?>
<?php
$xml=simplexml_load_file("CityList.xml");
foreach($xml as $child)
  {
  mysql_query("INSERT INTO `tr_in_city`set CityCode='$child->CityCode',CityName='$child->CityName',CountryCode='$child->CountryCode'") or die("not inserted");
  }
?>

Tuesday, 21 May 2013

url rewrite

URL rewriting on Linux Apache and wamp
For rewriting url on Centos Please do these steps.
  1. First go to '/etc/httpd/conf/httpd.conf' and for wamp left click on wamp icon and go to Apache then httpd.conf and uncomment - #LoadModule rewrite_module modules/mod_rewrite.so and #AddModule mod_rewrite.c, so do so please remove trailing #.

  2. Now Edit directory section in this file for directory /var/www/html and change 'AllowOverride none' to 'AllowOverride All'.

    Eg.
    Options Indexes FollowSymLinks
    AllowOverride none
    Order allow,deny
    Allow from all
    ;
    TO

    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    ;
  3. Now make a file in server root directory '/var/www/html' name .htaccess and write these line in this

Options +FollowSymlinks

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME}\.php -f

RewriteRule ^(.*).php$ $1.html [NC]

RewriteRule ^(.*).html$  $1.php [NC]



4-Now this will replace php extension in your file to .html extension  so now if you want to open index.php then write only http://url/index.html only instead of http://url/index.php

Tuesday, 7 May 2013

for submit form on change jquery




<script>
$(document).ready(function() {
alert("hello");
    $('#catname').change(function() {
        $('form').submit();
    });
});


</script>