Facebook Timeline Wall Script with PHP, Jquery, Mysql

Facebook Timeline Wallscript
Facebook Timeline Wallscript

Last modified on by Karthikeyan K

Facebook Style Wall Script is very popular among web developers. So I would like to tell how to create Clean Facebook Timeline Wall Script with php, mysql, jquery, ajax, & css. This is version 1 with lots of features and its FREE!

Facebook Timeline Wall Script Version 2.0 – Updated Click here
  • Share Updates
  • Add / upload pictures
  • Share Youtube Videos
  • Automatically Highlight Posts
  • Delete Updates
  • Infinite Scroll
facebook timeline wall script

facebook timeline wall script

Database Design for Facebook Timeline Wall Script


Security wise I have added more features like

  • Fix urls with protocol (http://, https://)
  • Remove PHP, Javascript Tags, Clean Texts
  • Clickable Text Links –Β  convert text to url hyperlink

facebook timline wall script

Facebook Timeline Wall Script – Version 1.0 contains 4 folders

  • assets
    • Stylesheets
    • Javascripts
    • Images
  • Includes
    • config.php
    • security.php
    • SimpleImage.php – used to upload images
  • Uploads – all pictures are uploaded to this folder

All you have to do is simply download and upload the sql file. finally some minor changes to be done in config.php


define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', '');
define('DB_DATABASE', 'fb_wall'); //your database name
define('ImageUploadPath', 'uploads/'); // image upload path
$post_limit = 10;
$connection = mysql_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD) or die(mysql_error());
$database = mysql_select_db(DB_DATABASE) or die(mysql_error());
mysql_query ("set character_set_results='utf8'");
$base_url='http://localhost/facebook-timeline-demo-1/'; //base url
$base_folder = "facebook-timeline-demo-1/"; //leave empty if you using root folder


//remove php tags from input
function clean($text)
$return_text = strip_tags($text);
return $return_text;

//remove special character from text
function special_chars($str)
$str = htmlentities($str, ENT_COMPAT, 'iso-8859-1');
$str = preg_replace('/&(.)(acute|cedil|circ|lig|grave|ring|tilde|uml);/', "$1", $str);
return $str;

//fixing the urls
function fix_url($url)
if (substr($url, 0, 7) == 'http://') { return $url; }
if (substr($url, 0, 8) == 'https://') { return $url; }
return 'http://'. $url;

function _make_url_clickable_cb($matches) {
$ret = '';
$url = $matches[2];

if ( empty($url) )
return $matches[0];
// removed trailing [.,;:] from URL
if ( in_array(substr($url, -1), array('.', ',', ';', ':')) === true ) {
$ret = substr($url, -1);
$url = substr($url, 0, strlen($url)-1);
return $matches[1] . "<a href=\"$url\" rel=\"nofollow\" target=\"_blank\">$url</a>" . $ret;

function _make_web_ftp_clickable_cb($matches) {
$ret = '';
$dest = $matches[2];
$dest = 'http://' . $dest;

if ( empty($dest) )
return $matches[0];
// removed trailing [,;:] from URL
if ( in_array(substr($dest, -1), array('.', ',', ';', ':')) === true ) {
$ret = substr($dest, -1);
$dest = substr($dest, 0, strlen($dest)-1);
return $matches[1] . "<a href=\"$dest\" rel=\"nofollow\" target=\"_blank\">$dest</a>" . $ret;

function _make_email_clickable_cb($matches) {
$email = $matches[2] . '@' . $matches[3];
return $matches[1] . "<a href=\"mailto:$email\">$email</a>";

function make_clickable($ret) {
$ret = ' ' . $ret;
// in testing, using arrays here was found to be faster
$ret = preg_replace_callback('#([\s>])([\w]+?://[\w\\x80-\\xff\#$%&~/.\-;:=,?@\[\]+]*)#is', '_make_url_clickable_cb', $ret);
$ret = preg_replace_callback('#([\s>])((www|ftp)\.[\w\\x80-\\xff\#$%&~/.\-;:=,?@\[\]+]*)#is', '_make_web_ftp_clickable_cb', $ret);
$ret = preg_replace_callback('#([\s>])([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})#i', '_make_email_clickable_cb', $ret);

// this one is not in an array because we need it to run last, for cleanup of accidental links within links
$ret = preg_replace("#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i", "$1$3</a>", $ret);
$ret = trim($ret);
return $ret;

//function used to fetch youtube video id
function get_youtubeid($url)
$parse = parse_url($url);
if(!empty($parse['query'])) {
preg_match("/v=([^&]+)/i", $url, $matches);
return $matches[1];
} else {
//to get basename
$info = pathinfo($url);
return $info['basename'];

thats it. You are done.

Please don’t forget to share and subscribe to latest updates of the blog. Also any comments and feedback are all welcome!


Verison 2
Facebook Timeline Wall Script Version 2.0 – Updated Click here

You May Also Like

58 Responses

  1. Sathish says:

    Cool script dude.. πŸ™‚ i need your script.. please enable the download link

  2. sol says:

    where can i download?

  3. Artur says:

    where download ?

  4. Sab says:

    Hii, Great work
    i need this script πŸ™‚

  5. Artur says:

    please share link

  6. elpaso says:

    please bro i need the script too….av been searching since last tow months for this kind of script….please!!!!

  7. Delaxsan says:

    i need this script…

  8. matilde says:

    Good job. I need your script too. Thanks

  9. sam says:

    i subscribed , kindly send me script of wall

  10. soniderot says:

    please share need learn programmer a wall :3

  11. Xuan Bao says:

    I’m interested in your script! Can you send me the source code? Thanks in advance πŸ™‚

  12. Nicky says:

    Sir, please mail me the script. I like you script very much..

  13. shaan4wp says:

    Hi Karthikeyan,
    Please send download link of Facebook Timeline on my email

  14. erick says:

    I want the script.. πŸ™ please send to my email

  15. ourprop says:

    This is the best implementation of a facebook timeline clone ive yet to see!

  16. Smyth M. says:

    Hello, Karthi!
    How I can download this script?


  17. Romeo Ohanekwu says:

    Dear Sir,
    I am building personal website and I need something like a mini blog on it and the timeline thingy comes within my need I have subscribed to your blog and would like you to kindly send me the facebook wall/timeline script.
    Thank you in advance.

  18. CCD White says:

    Hi Karthik!
    How can I Download the script?
    The ajax and post positioning is very good!

    Thanks in advance

  19. arosh says:

    great great great i was searching for this thing please send me the download link brother please

  20. arosh says:

    dear brother i got ur e mail.but cant find where to down load .please please help me .What i returned is to ur website.please help me.I have subscribed

  21. arosh says:

    ok extremely sorry i got it.its my mistake.ill come back to u

  22. Adrian says:

    please ..how to modify loadmore.php? show the next 10 post ..thanks

  23. cyna says:

    Hi Karthik!
    How β€œloadmore.php” load the data in the DB

  24. soniderot says:

    thanx i create the best wall http://laticat.x10.mx/profile.php?id=1 i use it code :3 is very nice thanx other time :3

  25. Ranbir Singh says:

    Hi, I need this script. Thanks

  26. nano says:


  27. mahendra says:

    hello sir ,
    please send me script my mail id is pratapm8@gmail.com
    great tutorial thx sir ji.

  28. Sajan Aneja says:

    I need this script… I must say u r brilliant……. B-)

  29. Sajan Aneja says:

    I need this script… I must say u r brilliant……. B-)

  30. tharindu says:

    dear sir, please update database.

    thank you

  31. karla says:

    Sir please update the database

    thank you πŸ˜€

  32. Josue David Montoya says:

    what’s wrong with the database, not updated yet…

  33. MH Eid says:

    Hello sir ,
    please send me script my mail id is lightsomali@gmail.com
    great tutorial thx sir

  34. Cyril says:

    Please, send me the script – macwilcy@gmail.com, subscribed to the mailing list, but could not get them mail. Thanks

  35. Ken Choong says:

    I just want to learn only..to understand the architeture of the Facebook.Please send me the script at matchartproduction@gmail.com

  36. Ken Choong says:

    I just want to learn only..to understand the architeture of the Facebook.Please send me the script at matchartproduction@gmail.com

  37. Karthick Acsh says:

    Hi,Sir Please update my mail id in your database, I have to add this feature in my current project, so hope u understand, please update soon, thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *