January 12, 2012

Facebook on your own Site or Blog

How to create or add facebook plugin into our Site or Web.??
This is what I've done :

  1. Go to http://developers.facebook.com/docs/plugins/
  2. Choose one of plugin that you want
  3. There are about 11 choice  :
    1. Like Button
    2. The Like button lets users share pages from your site back to their Facebook profile with one click.
    3. Send Button
    4. The Send button allows your users to easily send your content to their friends.
    5. Subscribe Button
    6. The Subscribe button allows people to subscribe to other Facebook users directly from your site.
    7. Comments
    8. The Comments plugin lets users comment on any piece of content on your site.
    9. Activity Feed
    10. The Activity Feed plugin shows users what their friends are doing on your site through likes and comments.
    11. Recommendations
    12. The Recommendations plugin gives users personalized suggestions for pages on your site they might like.
    13. Like Box
    14. The Like Box enables users to like your Facebook Page and view its stream directly from your website.
    15. Login Button
    16. The Login Button shows profile pictures of the user's friends who have already signed up for your site in addition to a login button.
    17. Registration
    18. The registration plugin allows users to easily sign up for your website with their Facebook account.
    19. Facepille
    20. The Facepile plugin displays the Facebook profile pictures of users who have liked your page or have signed up for your site.
    21. Live Stream
    22. The Live Stream plugin lets your users share activity and comments in real-time as they interact during a live event.
  4. Fill all the form, and then click get code

examples of database integration with combobox

Screen shoot :

This is the step :

First :

Make one database.
Exp : test

And then., Import this code to test database :


--
-- Table structure for table `sql_stat`
--
CREATE TABLE IF NOT EXISTS `sql_stat` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(25) NOT NULL,
  `statement` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Dumping data for table `sql_stat`
--
INSERT INTO `sql_stat` (`id`, `name`, `statement`) VALUES
(1, 'select', 'SELECT * FROM [nama_tabel]'),
(2, 'insert', 'INSERT INTO [nama_tabel] SET [nama_field]=[parameter_pemberi]');



Second :


Just Copy and Paste this code and save it with name : index.php
and then open your browser, call it -> exp : localhost/KIKISNE/dbTOcombobox/index.php
Note :
KIKISNE and dbTOcombobox is the name for the Folder on your htdocs.


<?php
/*  KSNE., ST on Jan 2012 | My BOLTEN
contoh integrasi database dengan combobox */

// untuk koneksi ke server dan database
$knks = mysql_connect("localhost","root","");
if (!$knks) die ('Cannot connect to server...');
$knksDB = mysql_select_db("test");
if (!$knksDB) die ('Cannot find Database...');

// untuk ambil data dan menampilkannya di combobox
$q = mysql_query("SELECT id,name,statement FROM sql_stat");
$jml = mysql_num_rows($q);
if ($jml>=1) {
echo '<select name="sqlStat" id="sqlStat" onChange="ksne();">';
echo '<option value="--">--</option>';
for ($i=0;$i<$jml;$i++) {
$dt = mysql_fetch_object($q);
echo '<option value="'.$dt->statement.'">'.$dt->name.'</option>';
}
echo '</select>';

// untuk menampilkan pilihan combobox di textbox
echo '&nbsp;<input type="text" name="tmpl" id="tmpl" size="100">';
}
?>
<script language="javascript">
function ksne() {
document.getElementById('tmpl').value=document.getElementById('sqlStat').value;
}
</script>
or.. you can download the source here

November 17, 2011

functions calculated using the Vietnamese language

Inspired by Facebook Friends Status who's being so dizzy looking for "functions calculated using the Vietnamese language".
And the I've got an Idea for editing my code to be Vietnamese through "Om Google".
This is it...  :
**Mohon dibantu ya… Sim salabim jadi apa .?? prok prok.. prok.. :)**



COPAS this code code., and save with name terbilang_vietnam.php :

<html>
<head>
<title>functions calculated using the Vietnamese language</title>
</head>
<body>
   <form action=”terbilang_vietnam.php” method=”post”>
   Masukkan angka: <input type=”text” value=”" name=”angka”>
   <input type=”submit” value=”Send”>
   </form>
   <pre>
   <?php
   $angka = isset($_POST['angka']) ? $_POST['angka'] : “0″;
   if ($angka) {
      echo number_format($angka, 0) . “<br>”;
      echo ucwords(Terbilang($angka));
   }
   ?>
   </pre>
</body>
</html>
<?php

function Terbilang($x) {
  $abil = array(“”, “one”, “hai”, “ba”, “four”, “nam”, “six”, “seven”, “eight”, “nine”, “ten”, “eleven”);
   if ($x < 12)
      return ” ” . $abil[$x];
   elseif ($x < 20)
      return Terbilang($x – 10) . “lòng thuong xót”;
   elseif ($x < 100)
      return Terbilang($x / 10) . ” hai muoi” . Terbilang($x % 10);
   elseif ($x < 200)
      return ” hundred” . Terbilang($x – 100);
   elseif ($x < 1000)
      return Terbilang($x / 100) . ” hundred” . Terbilang($x % 100);
   elseif ($x < 2000)
      return ” ngàn” . Terbilang($x – 1000);
   elseif ($x < 1000000)
      return Terbilang($x / 1000) . ” ngàn” . Terbilang($x % 1000);
   elseif ($x < 1000000000)
      return Terbilang($x / 1000000) . ” trieu” . Terbilang($x % 1000000);
   }
?>


Hopefully can help my friend....
Sorry for mistake in translate from Indonesian to Vietnamese :)
Because I'm not Vietnamese.

Just let me Know if I'm Wrong

See ya..
Wassalamualaikum Wr. Wb.
Rgds,
Kiki SNE