| Author |
I'm Rz Rasel
From Bangladesh
|
|
|
|
|
| |
B |
|
| |
Wednesday, January 4, 2012 |
|
| |
b |
|
| |
|
| |
|
|
| |
Php:- Check For Valid Email Address |
|
| |
Tuesday, January 3, 2012 |
|
| |
function checkEmail($email) { if( preg_match( "/[a-zA-Z0-9_-.+]+@[a-zA-Z0-9-]+.[a-zA-Z]+/", $email ) > 0 ) { return true; } else { return false; } }
Or function isValidEmail( $email ) { return preg_match( "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email ); }
Or $email = "someone@example.com"; if( eregi( "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email ) ) { echo "Valid email address."; } else { echo "Invalid email address."; }
PHP: Validating Numeric Values and Digits copy/* numeric, decimal passes */ function validate_numeric( $variable ) { return is_numeric($variable); }
/* digits only, no dots */ function is_digits( $element ) { return !preg_match ("/[^0-9]/", $element); }
|
|
| |
|
| |
|
|
| |
How To Insert Unicode Values To MySQL Using Java |
|
| |
Monday, January 2, 2012 |
|
| |
How To Insert Unicode Values To MySQL Using Java
Create a database in MySQL I used phpMyAdmin to create my database and sometimes i used MySQL GUI tools for check my values. MySQL GUI tools support to view Unicode values from a database See my SQL backup file below and you can restore this backup file using phpMyAdmin.
-- -- Database: `unicode` -- CREATE DATABASE `unicode` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; USE `unicode`;
-- --------------------------------------------------------
-- --------------------------------------------------------
-- -- Table structure for table `unicode` --
CREATE TABLE IF NOT EXISTS `unicode` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(100) NOT NULL, `job` varchar(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=20 ;
/* * To change this template, choose Tools | Templates * and open the template in the editor. */
package javaapplication1;
import java.sql.Connection; import java.sql.DriverManager; import javax.swing.JOptionPane;
/** * * @author Developer */ public class connection {
public Connection creatConnection () throws ClassNotFoundException { Connection conn=null;
try { Class.forName("com.mysql.jdbc.Driver").newInstance();//call jdbc driver String url = "jdbc:mysql://localhost/unicode?useUnicode=true&characterEncoding=UTF-8";//getting url conn = DriverManager.getConnection(url,"root","");//create connection }
catch (Exception e) { // JOptionPane.showMessageDialog(null,"Error occured!.."+ e.getLocalizedMessage()); JOptionPane.showMessageDialog(null, e.getMessage(), "Ooops",JOptionPane.ERROR_MESSAGE, null);//exeption hanling }
return conn;//return connection to all }
} |
|
| |
|
| |
|
|
|
|
| Problem In Font |
Download then zip file unzip and install in your system. Or normal font file just install in your system font folder. Rz Rasel |
| Bangla Font |
| Bangla Font |
|
|
|
|
|