A new start after a break of almost more than a year i think it's time to get back to it..... Hope to share some good stuff.... Wish me luck friends...
I am a Diamantaire by profession and Software Developer by passion. Born and brought up in Pink City and currently located in Mumbai.
Wednesday, 25 July 2012
Wednesday, 18 May 2011
Taking hindi input in PHP
Hey friends this is my first post on PHP.
Wish me Luck and let's see where can I take it up to.
Overview: - We have to take input in Hindi from a PHP page and save it in database and to populate it later on another page.
So guys what we using are as follows.
1.) PHP development tool: - Eclipse
2.) Database: - MySQL 5.0
3.) Database Browser: - MySQL Query Browser 5.0
4.) Designing: - HTML
5.) Server: - Apache 2.0 (XAMPP)
6.) Browser: - Firefox 4.0 Beta
7.) OS: - Microsoft Windows XP
So here we start First of all let’s create a database in name of Hindi_Data
CREATE DATABASE Hindi_Data
Now lets create a table in name of Details
CREATE TABLE Details
(
ID INTEGER (2) PRIMARY KEY,
NAME VARCHAR (100) CHARACTER SET UTF8
)
Now let's insert data in table.
To see Hindi fonts in MySQL Query Browser
Go to Tools > Options > General Options
Note: - Text Highlighted as RED in the given below code is something that's necessary to meet our requirements...
$dbhost = 'localhost';
$dbuser = 'Ank';
$dbpass = 'pass';
$database = "hindi_data";
?>
<title>Hindi Data entry</title>
<meta http-equiv="Content-Language" content="hi">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<form name="frm1" method="POST" action="HindiEntry.php">
<input type="hidden" name="posted" value="true" />
Enter Hindi Text : <input type="text" name="txt1" size="20" maxlength = "100" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>
<?php
include ("Connect.php");
if (isset($_POST['posted']))
{
$Connect = mysql_connect($dbhost, $dbuser, $dbpass) or
die("Cannot connect to the server");
mysql_select_db ($database, $Connect) or
die ("Cannot find database");
$txtinput = $_POST['txt1'];
$InsertQuery = "INSERT INTO Details (Name) VALUES ( '" . $txtinput . "')";
mysql_query ($InsertQuery, $Connect);
mysql_close($Connect);
}
?>
</body>
<title>Hindi Data entry</title>
<meta http-equiv="Content-Language" content="hi"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<?php
include ("Connect.php");
$Connect = mysql_connect($dbhost, $dbuser, $dbpass) or
die("Cannot connect to the server");
mysql_select_db ($database, $Connect) or
die ("Cannot find database");
$SelectQuery = "SELECT ID, NAME FROM details ORDER BY ID";
$QueryResult = mysql_query($SelectQuery, $Connect);
echo "<table border='1'>";
while($Hindi_Data = mysql_fetch_row($QueryResult))
{
echo "<tr><td>" . $ Hindi_Data[0]. "</td><td>" . $ Hindi_Data[1] . "</td></tr>";
}
echo "</table>";
mysql_close($Connect);
?>
</body>
</html>
Wish me Luck and let's see where can I take it up to.
Overview: - We have to take input in Hindi from a PHP page and save it in database and to populate it later on another page.
So guys what we using are as follows.
1.) PHP development tool: - Eclipse
2.) Database: - MySQL 5.0
3.) Database Browser: - MySQL Query Browser 5.0
4.) Designing: - HTML
5.) Server: - Apache 2.0 (XAMPP)
6.) Browser: - Firefox 4.0 Beta
7.) OS: - Microsoft Windows XP
So here we start First of all let’s create a database in name of Hindi_Data
CREATE DATABASE Hindi_Data
Now lets create a table in name of Details
CREATE TABLE Details
(
ID INTEGER (2) PRIMARY KEY,
NAME VARCHAR (100) CHARACTER SET UTF8
)
Now let's insert data in table.
To see Hindi fonts in MySQL Query Browser
Go to Tools > Options > General Options
Then change Default Font, Data Font and Code Font to "Arial Unicode MS"
Now Execute the INSERT Query and then the following SELECT Query.
SELECT ID, NAME FROM Details d;
Now the PHP and HTML Parts.
Connect.php
<?php
// MySQL Server Connection Information$dbhost = 'localhost';
$dbuser = 'Ank';
$dbpass = 'pass';
$database = "hindi_data";
?>
HindiEntry.php
<html lang="hi">
<head><title>Hindi Data entry</title>
<meta http-equiv="Content-Language" content="hi">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<form name="frm1" method="POST" action="HindiEntry.php">
<input type="hidden" name="posted" value="true" />
Enter Hindi Text : <input type="text" name="txt1" size="20" maxlength = "100" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>
<?php
include ("Connect.php");
if (isset($_POST['posted']))
{
$Connect = mysql_connect($dbhost, $dbuser, $dbpass) or
die("Cannot connect to the server");
mysql_select_db ($database, $Connect) or
die ("Cannot find database");
$txtinput = $_POST['txt1'];
$InsertQuery = "INSERT INTO Details (Name) VALUES ( '" . $txtinput . "')";
mysql_query ($InsertQuery, $Connect);
mysql_close($Connect);
}
?>
</body>
Now HindiView.php
<html lang="hi">
<head><title>Hindi Data entry</title>
<meta http-equiv="Content-Language" content="hi"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<?php
include ("Connect.php");
$Connect = mysql_connect($dbhost, $dbuser, $dbpass) or
die("Cannot connect to the server");
mysql_select_db ($database, $Connect) or
die ("Cannot find database");
$SelectQuery = "SELECT ID, NAME FROM details ORDER BY ID";
$QueryResult = mysql_query($SelectQuery, $Connect);
echo "<table border='1'>";
while($Hindi_Data = mysql_fetch_row($QueryResult))
{
echo "<tr><td>" . $ Hindi_Data[0]. "</td><td>" . $ Hindi_Data[1] . "</td></tr>";
}
echo "</table>";
mysql_close($Connect);
?>
</body>
</html>
So friends if have any doubts / problems then do ask.
--AnkDroid--
Tuesday, 17 May 2011
OOP's a imp part of a Developer's Life
Hey frnds
Its really a gr8 thing that i hv understood the concepts of OOP's so soon and not now i hv been learning a new thing in OOP's since my 11th standard......
I would comment over here that OOP's is a real thing about which a Software developers concepts should be clear.....
But Rajasthan University does not have something left to ask so they keep repeating questions from previous 6 years question papers.........
Today's paper was awesome just took me 1 1/2 hrs to complete my 3 hrs paper... Man I was just smiling what to do now!!!!!!!
Anyways let's come back to OOP's.
What is OOP's?
According to Wiki definition
Object-oriented programming (OOP)
Is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction, encapsulation, messaging, modularity, polymorphism, and inheritance. Many modern programming languages now support OOP.
Java, C#, PHP are some examples of it.......
In simple words OOP's is a thing which is based on classes and objects.....
Everything in OOP's are based on both of this.......
If i hv done any mistake then plz rectify!!!!!!
I will be delighted of that!!!!!!
Keep sharing the Knowledge and one day u will hv a lot of things in ur Hand!!!!!!
Its really a gr8 thing that i hv understood the concepts of OOP's so soon and not now i hv been learning a new thing in OOP's since my 11th standard......
I would comment over here that OOP's is a real thing about which a Software developers concepts should be clear.....
But Rajasthan University does not have something left to ask so they keep repeating questions from previous 6 years question papers.........
Today's paper was awesome just took me 1 1/2 hrs to complete my 3 hrs paper... Man I was just smiling what to do now!!!!!!!
Anyways let's come back to OOP's.
What is OOP's?
According to Wiki definition
Object-oriented programming (OOP)
Is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction, encapsulation, messaging, modularity, polymorphism, and inheritance. Many modern programming languages now support OOP.
Java, C#, PHP are some examples of it.......
In simple words OOP's is a thing which is based on classes and objects.....
Everything in OOP's are based on both of this.......
If i hv done any mistake then plz rectify!!!!!!
I will be delighted of that!!!!!!
Keep sharing the Knowledge and one day u will hv a lot of things in ur Hand!!!!!!
Sunday, 15 May 2011
EXAM'S the worst thing!!!!!
I would say that exams are really the worst thing a person can have in his life!!!!!
I accept that they should be there to test ur knowledge but always not on the wrong time!!!!
I am seriously fade up of Rajasthan University for preparing such a worst time table!!!!
We also want to enjoy holidays!!!!
Why does I have exam's on those days when there is a marriage of my Cousin's......
Missing all of my family having fun in Chennai....
Sorry Di could not make it up this time!!!!!!
I just wanted to be there having fun with you all!!!!
Home Alone!!!!!!
Congrats Di and Jiju !!!!
:)
Time to prepare for OOP's exam now!!!!!
:(
I accept that they should be there to test ur knowledge but always not on the wrong time!!!!
I am seriously fade up of Rajasthan University for preparing such a worst time table!!!!
We also want to enjoy holidays!!!!
Why does I have exam's on those days when there is a marriage of my Cousin's......
Missing all of my family having fun in Chennai....
Sorry Di could not make it up this time!!!!!!
I just wanted to be there having fun with you all!!!!
Home Alone!!!!!!
Congrats Di and Jiju !!!!
:)
Time to prepare for OOP's exam now!!!!!
:(
A new opportunity to me!!!!!
Good Morning guys a new dawn is welcoming me to my better future!!!!
I have been moved to PHP too.....
I am already onto Android and now PHP too......
<?php
?>
I love to play wid dese tags.....
Eclipse PDT IDE is a good thing to start the developments.....
Seeing a tougher days to be waiting for me.....
Bt not a prob will love to work more harder on those tougher days.
Want to crack something bigger out of all dese!!!!
--AnkDroid--
I have been moved to PHP too.....
I am already onto Android and now PHP too......
<?php
?>
I love to play wid dese tags.....
Eclipse PDT IDE is a good thing to start the developments.....
Seeing a tougher days to be waiting for me.....
Bt not a prob will love to work more harder on those tougher days.
Want to crack something bigger out of all dese!!!!
--AnkDroid--
Hummmm......
Hi Frnds,
Welcome to my first blog first post!!!!!
So any doubts or question on PHP, Android or .NET just go ahead and ask without hesitation....
As said and I believe that
"The Knowledge increases by sharing!!!!!! So let's get our brain's Sharper!!!!"
Welcome to my first blog first post!!!!!
So any doubts or question on PHP, Android or .NET just go ahead and ask without hesitation....
As said and I believe that
"The Knowledge increases by sharing!!!!!! So let's get our brain's Sharper!!!!"
Subscribe to:
Posts (Atom)
Terms and Conditions Old School Tic Tac Toe
Terms & Conditions By downloading or using the app, these terms will automatically apply to you – you should make sure therefore that y...
-
Hi Frnds, Welcome to my first blog first post!!!!! So any doubts or question on PHP, Android or .NET just go ahead and ask without hesit...
-
Hey friends this is my first post on PHP. Wish me Luck and let's see where can I take it up to. Overview: - We have to take input in...