Workaroud:
Instead of:
onclick="yourFunction(); return false;"
Use this:
onclick="yourFunction(); event.returnValue=false; return false;"
Feb 26, 2009
Feb 23, 2009
Coffeeandpase Blogger: A Heavy Downloader
I was on a download-spree for a while.
Every time i saw a product a few ideas popped into my head
and i wanted to download it immediately so i could make use of it in the future.
But fact is, i didn't use any of all those crappy products,
i just kept lurking around to find new ideas to chew on (which made me keep downloading shit). I even got top one bandwidth user in my previous company.
So i sat down, read a lot of useful threads on the net, noted a few things, did some brainstorming, and now i'm FINALLY about to launch my first little project. Still finalizing it right now, I will update this post once it's launched.
A simple advice for those heavy downloader pipz:
DO NOT WASTE YOUR TIME DOWNLOADING THE LATEST CRAP!
READ SOME USEFUL THREADS, GET AN IDEA OF WHAT YOU WANT TO DO,
DO SOME BRAINSTORMING, AND THEN, IF YOU STILL THINK YOU NEED A TOOL, GET IT, BUT USE IT!
Every time i saw a product a few ideas popped into my head
and i wanted to download it immediately so i could make use of it in the future.
But fact is, i didn't use any of all those crappy products,
i just kept lurking around to find new ideas to chew on (which made me keep downloading shit). I even got top one bandwidth user in my previous company.
So i sat down, read a lot of useful threads on the net, noted a few things, did some brainstorming, and now i'm FINALLY about to launch my first little project. Still finalizing it right now, I will update this post once it's launched.
A simple advice for those heavy downloader pipz:
DO NOT WASTE YOUR TIME DOWNLOADING THE LATEST CRAP!
READ SOME USEFUL THREADS, GET AN IDEA OF WHAT YOU WANT TO DO,
DO SOME BRAINSTORMING, AND THEN, IF YOU STILL THINK YOU NEED A TOOL, GET IT, BUT USE IT!
Where is php.ini?
The quick way to find out (assuming php4.3+) is
bash-2.05a$ php -r "phpinfo();" | grep Configuration
Configuration File (php.ini) Path => /etc
Configuration
If you can't do that (because you are using pre 4.3, for shame!) then try the <?php phpinfo() ?> script
bash-2.05a$ php -r "phpinfo();" | grep Configuration
Configuration File (php.ini) Path => /etc
Configuration
If you can't do that (because you are using pre 4.3, for shame!) then try the <?php phpinfo() ?> script
Feb 20, 2009
Make a face
MONOFACE
It just happened that I dropped by into this very cool, funny site.
Make a face, just click on face, nose, eyes,lips and find what you like the face to be.
Below is mine and it's so damn freak.
It just happened that I dropped by into this very cool, funny site.
Make a face, just click on face, nose, eyes,lips and find what you like the face to be.
Below is mine and it's so damn freak.
Turn your photo into a cartoon
Feb 18, 2009
Retrieving Japanese Text from MySQL using PHP
Our client's website is a multi-language website including Japanese and English.
It was working well until I was asked to develop a simple database ap for the site.
I have run into this problem.
It was working well until I was asked to develop a simple database ap for the site.
I have run into this problem.
When I try to retrieve the data from MySql using PHP. The data become "??????".(Question Marks)
* The data inside have Japanese and English.
So my db and table is defined as CHARSET=utf8 COLLATE=utf8_unicode_ci
* It display in the mySQL administration tools without any problem.
* It display normally in phpMyAdmin(web browser) too.
I know many developers also have run into this problem, so here's the block of code that did the trick for me.
Put this after the database connection.
mysql_query("SET NAMES 'utf8'")
* It display in the mySQL administration tools without any problem.
* It display normally in phpMyAdmin(web browser) too.
I know many developers also have run into this problem, so here's the block of code that did the trick for me.
Put this after the database connection.
mysql_query("SET NAMES 'utf8'")
Feb 13, 2009
CSS Play: Experiments with CSS
cssplay.co.ukA perfect place if you want to experiment with CSS.
I couldn’t find anything applicable, pretty enough, but i found great ideas i used to play with css properties and stuff I couldnt’t believe is possible with plain CSS elements styling.
New Online MD5 Hash Cracker!
GDataOnline.com is a fully functional MD5 hash cracker built with over 5.73 million unique entries. Its not meant to crack every possible word, but it'll crack any word from Swedish to Japanese and cars to anime. Give it a whirl, and if you wish, submit a word or two!
Feb 12, 2009
PNG Alpha Transparency Fix in IE
If you are a web designer, you know that PNG image rocks for its fine alpha transparency support. But lacking of support on IE6 and below, probably has made you sick for seeking some fixes.
Some made it to work with the use of javascipt and some with PHP.
But this guy made it in pure CSS.
visit this link for step-by-step instructions:
http://www.pluitsolutions.com/2007/11/18/png-image-fix-for-ie/
Some made it to work with the use of javascipt and some with PHP.
But this guy made it in pure CSS.
visit this link for step-by-step instructions:
http://www.pluitsolutions.com/2007/11/18/png-image-fix-for-ie/
Blogger.com as a website instead of a blog?
It was really a nice article I found a while ago wandering once again on the net.
thewayofcoding.com/200...
I never thought of that before, I can't just imagine how odd it is to hear that you are having yoursite.blogspot.com as your website unless if you will buy your own domain and have it hosted on blogger. Maybe I'll give it a try, maybe sooner or later. yah ..maybe.
thewayofcoding.com/200...
I never thought of that before, I can't just imagine how odd it is to hear that you are having yoursite.blogspot.com as your website unless if you will buy your own domain and have it hosted on blogger. Maybe I'll give it a try, maybe sooner or later. yah ..maybe.
Email address validation using Javascript
In forms when using email ID fields it is a good idea to use client side validation along with your programming language validation. The following example shows how you can validate an email address for a form. The script is cross browser compatibe (works for all browsers).
<script language = "Javascript">
/**
* DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
*/
function echeck(str) {
var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if (str.indexOf(at)==-1){
alert("Invalid E-mail ID")
return false
}
if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
alert("Invalid E-mail ID")
return false
}
if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
alert("Invalid E-mail ID")
return false
}
if (str.indexOf(at,(lat+1))!=-1){
alert("Invalid E-mail ID")
return false
}
if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
alert("Invalid E-mail ID")
return false
}
if (str.indexOf(dot,(lat+2))==-1){
alert("Invalid E-mail ID")
return false
}
if (str.indexOf(" ")!=-1){
alert("Invalid E-mail ID")
return false
}
return true
}
function ValidateForm(){
var emailID=document.frmSample.txtEmail
if ((emailID.value==null)||(emailID.value=="")){
alert("Please Enter your Email ID")
emailID.focus()
return false
}
if (echeck(emailID.value)==false){
emailID.value=""
emailID.focus()
return false
}
return true
}
</script>
<form name="frmSample" method="post" action="#" onSubmit="return ValidateForm()">
<p>Enter an Email Address :<input type="text" name="txtEmail"></p>
<p><input type="submit" name="Submit" value="Submit"></p>
</form>
source
<script language = "Javascript">
/**
* DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
*/
function echeck(str) {
var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if (str.indexOf(at)==-1){
alert("Invalid E-mail ID")
return false
}
if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
alert("Invalid E-mail ID")
return false
}
if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
alert("Invalid E-mail ID")
return false
}
if (str.indexOf(at,(lat+1))!=-1){
alert("Invalid E-mail ID")
return false
}
if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
alert("Invalid E-mail ID")
return false
}
if (str.indexOf(dot,(lat+2))==-1){
alert("Invalid E-mail ID")
return false
}
if (str.indexOf(" ")!=-1){
alert("Invalid E-mail ID")
return false
}
return true
}
function ValidateForm(){
var emailID=document.frmSample.txtEmail
if ((emailID.value==null)||(emailID.value=="")){
alert("Please Enter your Email ID")
emailID.focus()
return false
}
if (echeck(emailID.value)==false){
emailID.value=""
emailID.focus()
return false
}
return true
}
</script>
<form name="frmSample" method="post" action="#" onSubmit="return ValidateForm()">
<p>Enter an Email Address :<input type="text" name="txtEmail"></p>
<p><input type="submit" name="Submit" value="Submit"></p>
</form>
source
PHPMailer: SMTP Authentication
Most of the hosting providers today disable anonymous user on their server or do not allow to send mail through script without SMTP authentication to stop the spamming from their servers. In such cases, you have to use SMTP authentication to send mail through PHP, ASP, or ASP.Net script. Below is the sample SMTP authentication script to send mail through PHP script using PHPMailer:
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "smtp.domain.com"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "email@domain.com"; // SMTP username
$mail->Password = "password"; // SMTP password
$mail->From = "email@domain.com";
$mail->FromName = "Name";
$mail->AddAddress("Recipient@emailaddress.com","Name");
$mail->AddReplyTo("yourname@domain.com","Your Name");
$mail->WordWrap = 50; // set word wrap
$mail->IsHTML(true); // send as HTML
$mail->Subject = "Here is the subject";
$mail->Body = "This is the HTML body";
$mail->AltBody = "This is the text-only body";
if(!$mail->Send())
{
echo "Message was not sent";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
?>
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "smtp.domain.com"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "email@domain.com"; // SMTP username
$mail->Password = "password"; // SMTP password
$mail->From = "email@domain.com";
$mail->FromName = "Name";
$mail->AddAddress("Recipient@emailaddress.com","Name");
$mail->AddReplyTo("yourname@domain.com","Your Name");
$mail->WordWrap = 50; // set word wrap
$mail->IsHTML(true); // send as HTML
$mail->Subject = "Here is the subject";
$mail->Body = "This is the HTML body";
$mail->AltBody = "This is the text-only body";
if(!$mail->Send())
{
echo "Message was not sent";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
?>
For more info about the PHPMailer Class, visit phpmailer.codeworxtech.com
Subscribe to:
Posts (Atom)

