Thursday, July 29, 2010

A sample facebook app using PHP

require_once 'facebook.php';
error_reporting(1);
$appapikey = 'xxxxxxx';
$appsecret = 'xxxxxxx';
$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook->require_login();

$loikhuyen = $_GET['loikhuyen'];
$host = "http://forum.mvcorp.vn:81/loikhuyen/";
$user_details = $facebook->api_client->users_getInfo($user_id, 'first_name, last_name, sex, birthday, birthday_date');




/////////////your code here/////////////

include("footer.php");
?>

Wednesday, July 28, 2010

Some opensource PHP code

Here are some websites that share code in PHP from begginer to advanced


- http://pscode.com
- http://sf.net
- http://freecodevn.com

PHP editor

Do you know that without of knowing HTML tag you still design your website.

With the help of software: dreamwaver, frontpage,...


And some software help you to code php: phpedit, Rapid PHP Editor, PHP Designer,.....


That's some tools to help you code php so simple and flexible

Happy coding!

First lession: simple code

Now, you known to setup a webserver.

With XAMPP, you go to htdocs directory and create a php file like hello.php

edit it with notepad:


echo "This is my first code PHP";
?>

Save it.

Now, test your code. You must start XAMPP first, then run this code

go to http://localhost/hello.php


You 'll see This is my first code PHP on the webpage

Is it easy for you ? Then you should know some basic HTML tags. Find them on Google

Note: Google make me lazy but great. I know many things from it.

How many languages you must learn to code a php apps

Here are the list:
- PHP
- CSS
- MySQL
- HTML
- Javascript
- Flash ( if you want to make game online base on flash)

If you're a begginer, don't care about other but PHP, HTML, Javascript. You can code some great apps like company introduce site, album site,...

Webserver

First you must have a webserver to run PHP script.

There are  a lot of webserver that intergrate all in one: PHP, apache, mysql. You download it and run.


I suggest a webserver that I'm using is XAMPP http://www.apachefriends.org/

You can download version on WIN, MAC or LINUX base on your OS. I''m running WINDOWS XP

Please download it and read help to install it. Just some steps.

Welcome blog !

Welcome you to my blog !

I like programming in PHP, so create this blog to share my experience about everything I know about PHP.

- How to create a website in PHP

- Write some simple apps
- Tips

Hope you enjoin this blog.

Thanks.

Contact me at YM!: andhvn