Pages

Tuesday, March 26, 2013

how to fix the weird redirection problem in wordpress after migrate from localhost to live server

I have create a wordpress website online which i need to move to my offline localhost server to modify the things, everything was working fine except the wp-admin redirection whenever i tried to open my admin panel by visiting link localhost/mysite/wp-admin it was redirecting me to my website url from where i had downloaded all the files http://mywebsite/wp-admin.

By searching a lot i didn't get any good response then i start searching the things in database on phpmyadmin.
and what i find there :). It was an entry on wordpress table wp-options  inside that there is a column option_name and option_value. I changed the sitename value to localhost and its start redirecting to my localhost path only.

database -> wp-options -> option_name(siteurl) -> option_value(your url)

posted by honeyonsys

Tuesday, March 19, 2013

how to block a website on a computer by editing admin file and how to give permission to edit the admin file

You can block any website to open on your computer by editing a windows file located in

c:/windows/system32/drivers/etc/

the file named hosts





edit this file with notepad.

and put the website name at the below which you want to block like the below image


in the above image you can see that i have mention the facebook website with an ip address. The ip address will be mentioned already with the host name their, copy that ip address and put the website address after that which you want to block. and save it.

Error while saving the host file Access Denied!

If you computer denied your request to save the hosts file, it will mean that the current user you are logged in to your pc is dont have the permission to edit or write admin file or windows file for that you can follow the following steps:

You need to give permissions to the File/folder, follow the steps below:

# Right-click the file and select Properties.
# Click on the Security tab.
# Click Advanced in the lower right.
# In the Advanced Security Settings window that pops up, click on the Owner tab.
# Click Edit.
# Click Other users or groups.
# Click Advanced in the lower left corner.
# Click Find Now.
# Scroll through the results and double-click on your current user account.
# Click OK to all of the remaining windows except the first Properties window.
# Select your user account from the list up top and click Edit.
# Select your user account from the list up top again and then in the pane below, check Full control under Allow, or as much control as you need.
# You’ll get a security warning, click Yes.
# On some files that are essential to Windows, you’ll get a “Unable to save permission changes… access is denied” warning and there’s nothing that you can do about it to the best of my knowledge.


Try it :)


posted by honeyonsys

Monday, March 18, 2013

javascript to disable right click on a web page.


You can disable the right click on any webpage by putting the follwing javascript code under the tag.




you should type this of your own. This is how u will learn :)


posted by honeyonsys

Thursday, March 14, 2013

How to Manage the Hard Disk Space in Windows 7

Step 1:

Go to Windows 7 Menu and choose control panel. you will see a window like shown below. choose 'System and Security'.




Step 2:

you will see a window like given below.Choose 'Administrative Tools'.




Step 3:

Now you will see a pop-up that contains a no of icons that are associted with different functionalities . choose 'Computer Management'.Now this will open another Window of 'Computer management'. From this window choose 'Storage'.




Step 4:

After choosing storage option ,you will find only one option 'Disk Management'. So, choose it. Now, you will see the 'information about your hard disk as well as other storage devices connected to your computer at that time'. Now to manage any part of your hard disk or any other storage device just 'right click' on it you will see options like 'Shrink ,Extend, Delete etc' as per possibility. So ,do whatever you want with it...










Tutorial HTML for beginners part 4 of 4


Tutorial HTML for beginners part 4 of 4



posted by honeyonsys

Tutorial HTML for beginners part 3 of 4


Tutorial HTML for beginners part 3 of 4



posted by honeyonsys

Tutorial HTML for beginners part 2 of 4


Tutorial HTML for beginners part 2 of 4




posted by honeyonsys

Tutorial HTML for begginers part 1 of 4


Tutorial HTML for beginners part 1 of 4

click to see the video


posted by honeyonsys

Wednesday, March 6, 2013

Error while connecting to the mysql databse with php whereas username and password are correct

Some time you face this problem specially new programmers while connecting to the mysql database that they are not able to connect it to the database on their hosting server whereas their username and password they have created are correct. So what the thing they missed out?

Its the hosting service prefix

whenever you are in any hosting serivice its having a username prefix for example

user login for hosting service bibo123 and password *******

so whenevr you create a database and new user to that hosting account it will prefic the bibo123_ on that database name and username too. So if you are having a database name student it will prefix the bibo123_ to it and it will become bibo123_student. so as it will do with the username also. for description their is an example below to connect to mysql database

hosting login: bibo123_
username you created: jinah
password: pikachu


$username = bibo123_jinah;
$password = bibo123_password
mysql_connect("localhost", $username, $password) or die(mysql_error());
echo "Connected to MySQL
";
try it.



posted by honeyonsys

Print the next highest integer value by rounding up value with javascript

To convert a decimal value like 4.5 to a round value to its nearest decimal integer we have three main function in the javascript library

Math.ceil() = Round a number upward to it's nearest integer:
Math.round() = Round a number to the nearest integer:
Math.floor() = Round a number downward to its nearest integer:



Round() example

var a=Math.round(2.60);
var b=Math.round(2.50);
var c=Math.round(2.49);
var d=Math.round(-2.60);
var e=Math.round(-2.50);
var f=Math.round(-2.49);

Result

3
3
2
-3
-2
-2


Ceil() example

var a=Math.ceil(0.60);
var b=Math.ceil(0.40);
var c=Math.ceil(5);
var d=Math.ceil(5.1);
var e=Math.ceil(-5.1);
var f=Math.ceil(-5.9);

Result

1
1
5
6
-5
-5


floor() example

var a=Math.floor(0.60);
var b=Math.floor(0.40);
var c=Math.floor(5);
var d=Math.floor(5.1);
var e=Math.floor(-5.1);
var f=Math.floor(-5.9);

Result

0
0
5
5
-6
-6

Print the next highest integer value by rounding up value with php

To make a round value from an decimal value like:

3.4 to 4
5.6 to 6

you can use the php ceil function, ceil - Round fractions down

its syntax is float ceil ( float $value )

example 

echo ceil(3.4);    // 4
echo ceil(9.999);  // 10


for a value Round fraction down you can use the floor()

example

echo floor(4.3);   // 4
echo floor(9.999); // 9
echo floor(-3.14); // -4


and one is the round() function which returns the nearest round value to the decimal

echo round(3.4);         // 3
echo round(3.5);         // 4
echo round(3.6);         // 4
echo round(3.60);      // 4
echo round(1.955832);  // 1.96
echo round(1241757, -3); // 1242000
echo round(5.0452);    // 5.05
echo round(5.0552);    // 5.06


for more detail or reference you can see the detail documentation on http://www.php.net/manual/en/function.round.php


posted by honeyonsys

Tuesday, March 5, 2013

How to make gradient effect with css only (without using image)

You can use this trick to make a
background like a gradient with using only css (no background image needed). the code is here


you will get the out put as follows



you can use -webkit- and -moz- for mozilla or other unsupportive style browser. but this cant be work in below IE9.

test it :).



posted by honeyonsys

Sunday, March 3, 2013

How to enable text format toolbar in tinymce editor

To enable or display font editor toolbar you need to add the few lines into your tinyMCE.init() function.


tinyMCE.init({
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
    theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
    theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
)};


posted by honeyonsys

how to change the format of date and time inside a mysql database?

To change the date format inside a mysql datatable only for matching the term passing to it there are DATE_FORMAT option available in mysql documentation.

one of the popular function is use here is DATE_FORMAT. An example shown below will explain the proper use of this function inside the mysql datatable

suppose if you have table
idnameoccupationdate_addedcity
1harishweb developer13 feb 2013, 12:56 PMNew Delhi
2johnweb developer16 feb 2013, 12:14 AMNew Jersey
3Venusweb designer15-1-2013, 11:09 AMNew Delhi
4Billyanimatorfebuary 19 2013, 16:08 PMNew York

here in this table you can see that there are different formats of date mention in the date_added column. so if we want to match here the time according to a specific time format so how do we do it.
like if we want a row to be selected with a date format (20-01-2013). so for doing this we only need to pass this query

SELECT * FROM `table` WHERE DATE_FORMAT(date_added, '%Y-%m-%d')='matching_date'; 

if the above query will not work so you can try STR_TO_DATE also. this function make a string to a date format

SELECT * FROM `table` WHERE DATE_FORMAT(STR_TO_DATE(date_added,'%d-%b-%Y %l:%i %p'), '%Y-%m-%d')='matching_date'

in the above query we convert the saved date_added column into a date format with STR_TO_DATE function.


for some of the more useful date function you can refer the following table also



NameDescription
ADDDATE()Add time values (intervals) to a date value
ADDTIME()Add time
CONVERT_TZ()Convert from one timezone to another
CURDATE()Return the current date
CURRENT_DATE(),CURRENT_DATESynonyms for CURDATE()
CURRENT_TIME(),CURRENT_TIMESynonyms for CURTIME()
CURRENT_TIMESTAMP(),CURRENT_TIMESTAMPSynonyms for NOW()
CURTIME()Return the current time
DATE_ADD()Add time values (intervals) to a date value
DATE_FORMAT()Format date as specified
DATE_SUB()Subtract a time value (interval) from a date
DATE()Extract the date part of a date or datetime expression
DATEDIFF()Subtract two dates
DAY()Synonym for DAYOFMONTH()
DAYNAME()Return the name of the weekday
DAYOFMONTH()Return the day of the month (0-31)
DAYOFWEEK()Return the weekday index of the argument
DAYOFYEAR()Return the day of the year (1-366)
EXTRACT()Extract part of a date
FROM_DAYS()Convert a day number to a date
FROM_UNIXTIME()Format UNIX timestamp as a date
GET_FORMAT()Return a date format string
HOUR()Extract the hour
LAST_DAYReturn the last day of the month for the argument
LOCALTIME()LOCALTIMESynonym for NOW()
LOCALTIMESTAMP,LOCALTIMESTAMP()Synonym for NOW()
MAKEDATE()Create a date from the year and day of year
MAKETIMEMAKETIME()
MICROSECOND()Return the microseconds from argument
MINUTE()Return the minute from the argument
MONTH()Return the month from the date passed
MONTHNAME()Return the name of the month
NOW()Return the current date and time
PERIOD_ADD()Add a period to a year-month
PERIOD_DIFF()Return the number of months between periods
QUARTER()Return the quarter from a date argument
SEC_TO_TIME()Converts seconds to 'HH:MM:SS' format
SECOND()Return the second (0-59)
STR_TO_DATE()Convert a string to a date
SUBDATE()A synonym for DATE_SUB() when invoked with three arguments
SUBTIME()Subtract times
SYSDATE()Return the time at which the function executes
TIME_FORMAT()Format as time
TIME_TO_SEC()Return the argument converted to seconds
TIME()Extract the time portion of the expression passed
TIMEDIFF()Subtract time
TIMESTAMP()With a single argument, this function returns the date or datetime expression; with two arguments, the sum of the arguments
TIMESTAMPADD()Add an interval to a datetime expression
TIMESTAMPDIFF()Subtract an interval from a datetime expression
TO_DAYS()Return the date argument converted to days
UNIX_TIMESTAMP()Return a UNIX timestamp
UTC_DATE()Return the current UTC date
UTC_TIME()Return the current UTC time
UTC_TIMESTAMP()Return the current UTC date and time
WEEK()Return the week number
WEEKDAY()Return the weekday index
WEEKOFYEAR()Return the calendar week of the date (0-53)
YEAR()Return the year
YEARWEEK()Return the year and week




Formats the date value according to the format string.
The following specifiers may be used in the format string. The % character is required before format specifier characters.

SpecifierDescription
%aAbbreviated weekday name (Sun..Sat)
%bAbbreviated month name (Jan..Dec)
%cMonth, numeric (0..12)
%DDay of the month with English suffix (0th1st2nd3rd, …)
%dDay of the month, numeric (00..31)
%eDay of the month, numeric (0..31)
%fMicroseconds (000000..999999)
%HHour (00..23)
%hHour (01..12)
%IHour (01..12)
%iMinutes, numeric (00..59)
%jDay of year (001..366)
%kHour (0..23)
%lHour (1..12)
%MMonth name (January..December)
%mMonth, numeric (00..12)
%pAM or PM
%rTime, 12-hour (hh:mm:ss followed by AM or PM)
%SSeconds (00..59)
%sSeconds (00..59)
%TTime, 24-hour (hh:mm:ss)
%UWeek (00..53), where Sunday is the first day of the week
%uWeek (00..53), where Monday is the first day of the week
%VWeek (01..53), where Sunday is the first day of the week; used with %X
%vWeek (01..53), where Monday is the first day of the week; used with %x
%WWeekday name (Sunday..Saturday)
%wDay of the week (0=Sunday..6=Saturday)
%XYear for the week where Sunday is the first day of the week, numeric, four digits; used with %V
%xYear for the week, where Monday is the first day of the week, numeric, four digits; used with %v
%YYear, numeric, four digits
%yYear, numeric (two digits)
%%A literal % character
%xx, for any x not listed above


the above reference with the source of http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-format


posted by honeyonsys

About Me

Hi,My name is Harish Kumar.I am a web developer by profession.I am working in the same field since 2008. About my skills i am proficient in HTML,CSS,JAVASCRIPT/JQUERY/ ANGULAR,PHP,MYSQL,APACHE,LINUXAJAX, REST,etc...