Php mailer

Example

Download  it  here : PHPMailer_5.2.4

Another Examples:

 

 

 

 

Php Smarty template lib

It is perfect template lib for php developers,  Easy to develop specific projects and increase speed of the project.

Code Example :

Of course  you should install your smarty  to your server. 

Quick Smarty Install
In Debian Etch:

Now you have a Smarty install. To use it, you’ll need PHP code to drive Smarty. I’ll include a sample bit of PHP code that I was working on with Mike A:

 

Now, for Smarty to operate you need to supply some directories (i.e. template_dir, compile_dir, cache_dir, config_dir). compile_dir and cache_dir need to writeable by the web server user so in Debian something like:

Write default.tpl into $DIR/smarty/templates/default.tpl . For example,

* 1.  Download smarty packages

* 2.  Extract  them somewhere else

* 3 . Write extration path to inside of  php.ini file,   include_path

* 4. then restart httpd

5 . Create   php file ,     (write template folder path )

6. Create Template file .

7.

 

 

Now, moving from here would be something like:

1. Writing code to check for a navbar.txt in the current direction. If not found, stuff navbar Smarty tag with “Back up a level” that moves up one subdirectory (i.e. go to /directory/index.html if you were are /directory/author.html, and go to /index.html when you were are /directory/index.html, etc.)
2. Could proceed by designing a number of templates in Smarty for the same basic content – i.e. skin-bluesteel.tpl and then providing a user interface to switch templates.
3. Perhaps eliminate filesystem reliance and put URL’s into a database.

Map /directory to /directory/index.html, similar with /.

If not in database, display a generic 404 error. You can develop this script by calling it like
/database-script-were-writing.php/directory/index.html and then looking into
PATH_INFO from the server which will contain /directory/index.html .

Once you have this perfected, you set up apache with something like
“Alias / /var/www-sites.d/malborn.kutayzorlu.com/database-script-were-writing.php”

and everything should pretty much just work.

PHP mycryp and Mysql Togetger

 

php explode usage examples – split.

Use PHP’s explode.

 

.

PHP+MySQL’de Türkçe Karakter Problemini Önlemek

PHP+MySQL’de Türkçe Karakter Problemini Önlemek

Html ve php dosyalarınızı yazarken özgür yazılım ürünü olan Notepad++ programını kullanmanızı öneriyorum. Sitenizi oluşturmaya, html ve php kodlarınızı yazmaya başlamadan önce notepad++’ı açıp Format menüsünden UTF-8 without BOM‘u seçin ve dosyalarınızı utf8 formatını kullanarak yazın. Notepad++’ın Settings>Preferences>New Document bölümünden de her açılışta dosya formatını otomatik olarak utf-8 without bom seçmesini sağlayabiliriz.
Daha sonra html kodlarınızı yazmaya başlayabilirsiniz. HTML ile de sayfanızın karakter setini UTF-8 olarak ayarlamanız gerekiyor.etiketlerinin arasına yerleştireceğiniz aşağıdaki kod ile bu işi yapacağız.


Şimdi MySQL veritbanımızı oluşturalım.. Veritabanımızı oluştururken Karşılaştırma bölümünden utf8_turkish_ci yi seçmenizi öneriyorum. Böylelikle MySQL’de oluşturacağınız tüm tablo ve alanlar utf8 kodlamasına göre oluşturulacak. Artık MySQL’den veri girişi yaptığınızda Türkçe karakter problemi olmadan verilerinizi görebiliyor olmalısınız.

PHP kodlarıyla MySQL’e bağlanırken yapmamız gerekn bir şey daha var. SET NAMES utf8 kodunu çalıştırmak.. Bunu da şu şekilde yapıyoruz;