Thursday, December 27, 2007

HTML PHP CSS Web 2.0

HTML PHP CSS Web 2.0

Check it out for more Info:

http://www.cgitop.com

Javascript Amazings

check it out
http://www.c6software.com/Products/PopBox/Default.aspx


Tuesday, December 18, 2007

Mysql encription

SELECT id, usertypeid, username, firstname, lastname, AES_DECRYPT(
PASSWORD , 'xxsxw342xx' )
FROM iplat_user_profile
WHERE username = 'demo123'


xxsxw342xx - > encription key



Monday, December 10, 2007

How to expire the session after particular time in php?

we can  use this method
setcookie("PHPSESSID",$_COOKIE['PHPSESSID'],time()+900);


Thursday, December 6, 2007

Mysql Dump for more table in single query

mysqldump --add-drop-table -h localhost -u root -p databasename accounts countries userdetails >databasedump.sql

Thursday, November 29, 2007

Mysql Dump for single table

To dump the single table in the database.
mysqldump -u root dbname tabelname>file.sql


Wednesday, November 28, 2007

what's the difference between onbeforeunload and onunload?


what's the difference between onbeforeunload and onunload?
onunload
   once the page closed or refresh or reload it will call.
<body onunload="logout();">

onbeforeunload :
    before the page clos or refresh or reload it will call.

<body onbeforeunload="logout();">

Tuesday, November 20, 2007

Jquery Hints

Find some usefull links for Jquery

http://www.stilbuero.de/jquery/tabs/#fragment-17
http://marcgrabanski.com/code/jquery-calendar/
http://interface.eyecon.ro/demos/cart.html
http://education.llnl.gov/jQuery/
http://interface.eyecon.ro/demos/sort.html
http://interface.eyecon.ro/demos/windows.html
http://interface.eyecon.ro/demos/
http://interface.eyecon.ro/demos/ifx.html#drop-fx
http://www.codylindley.com/blogstuff/js/jquery/
http://www.ajaxdaddy.com/web20/sidenotes/#

Thursday, November 15, 2007

Javascript Cookies

Create and Store a Cookie

In this example we will create a cookie that stores the name of a
visitor. The first time a visitor arrives to the web page, he or she
will be asked to fill in her/his name. The name is then stored in a
cookie. The next time the visitor arrives at the same page, he or she
will get welcome message.

First, we create a function that stores the name of the visitor in a
cookie variable:

function setCookie(c_name,value,expiredays)
{
var exdate=new Date()
exdate.setDate(exdate.getDate()+expiredays)
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
}

The parameters of the function above hold the name of the cookie, the
value of the cookie, and the number of days until the cookie expires.

In the function above we first convert the number of days to a valid
date, then we add the number of days until the cookie should expire.
After that we store the cookie name, cookie value and the expiration
date in the document.cookie object.

Then, we create another function that checks if the cookie has been set:

function getCookie(c_name)
{
if (document.cookie.length>0)
{
c_start=document.cookie.indexOf(c_name + "=")
if (c_start!=-1)
{
c_start=c_start + c_name.length+1
c_end=document.cookie.indexOf(";",c_start)
if (c_end==-1) c_end=document.cookie.length
return unescape(document.cookie.substring(c_start,c_end))
}
}
return ""
}

The function above first checks if a cookie is stored at all in the
document.cookie object. If the document.cookie object holds some
cookies, then check to see if our specific cookie is stored. If our
cookie is found, then return the value, if not - return an empty
string.

Last, we create the function that displays a welcome message if the
cookie is set, and if the cookie is not set it will display a prompt
box, asking for the name of the user:

function checkCookie()
{
username=getCookie('username')
if (username!=null && username!="")
{alert('Welcome again '+username+'!')}
else
{
username=prompt('Please enter your name:',"")
if (username!=null && username!="")
{
setCookie('username',username,365)
}
}
}

All together now:

<html>
<head>
<script type="text/javascript">
function getCookie(c_name)
{
if (document.cookie.length>0)
{
c_start=document.cookie.indexOf(c_name + "=")
if (c_start!=-1)
{
c_start=c_start + c_name.length+1
c_end=document.cookie.indexOf(";",c_start)
if (c_end==-1) c_end=document.cookie.length
return unescape(document.cookie.substring(c_start,c_end))
}
}
return ""
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date()
exdate.setDate(exdate.getDate()+expiredays)
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
}

function checkCookie()
{
username=getCookie('username')
if (username!=null && username!="")
{alert('Welcome again '+username+'!')}
else
{
username=prompt('Please enter your name:',"")
if (username!=null && username!="")
{
setCookie('username',username,365)
}
}
}
</script>
</head>

<body onLoad="checkCookie()">
</body>
</html>

The example above runs the checkCookie() function when the page loads.

--
Thankyou
with regards
Shanmugarajan.k

http://letus-know.blogspot.com/

IFrame Breaker

Another one of those hidden-demo type scripts. Basically, this script
breaks you out of frames you may have encountered before this page (as
often happens in the web). This is a very usefull script to put on
your index page if you have a non-frame page. The source...


<script language="Javascript">
<!--
// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com

if (top.location != self.location) {
top.location = self.location.href
}

//-->
</script>


--
Thankyou
with regards
Shanmugarajan.k

http://letus-know.blogspot.com/

Tuesday, November 13, 2007

Preg_replace

    $filecontent = str_replace("<h2>Fig","<h2 style='display:none'>Fig",$filecontent);
    $filecontent = str_replace("<h4><fn><p>","<fn><p>",$filecontent);
    $filecontent = str_replace("</fn></h4></p>","</p></fn>",$filecontent);
    $filecontent = str_replace("<li><p>","<li>",$filecontent);
    $filecontent = str_replace("</p><br /></li>","<br /></li>",$filecontent);
    $filecontent = str_replace(".jpg",".gif",$filecontent);
    $filecontent=preg_replace("/\<div class=\"fig\" >(.*?)<\/div>/","",$filecontent);
    $filecontent=preg_replace("/\<h2 style='display:none'>Fig.(.*?)<\/h2>/is","",$filecontent);
   
    $filecontent=preg_replace("/\<br \/><b>(.*?)<\/b><br \/>/is","<p><h2>\\1</h2></p>",$filecontent);
    $filecontent=preg_replace("/\<br \/><b>(.*?)<\/b><br \/>/is","<p><h2>\\1</h2></p>",$filecontent);
    $filecontent=preg_replace("/\<xyz>(.*?)<\/xyz>/is","<h6>\\1</h6>",$filecontent);
    $filecontent = str_replace("<xyz>","",$filecontent);
    $filecontent = str_replace("</xyz>","",$filecontent);
    $filecontent = str_replace("<abcd>","<br /><br />",$filecontent);

Saturday, October 13, 2007

About this blog

Hi friends,
 Here i am Planning to put some usefull information on php, mysql, html and ajax tips and tricks..hope it will be useful for us..