Loading
Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Writing Proxy Server for particular site in PHP with one line (HTTP GET only)

I cannot get access to stackoverflow today again.

So here it is tiny proxy server for http get request, I've written today.

<?php echo preg_replace('|"\/|','"/?x=',file_get_contents('http://stackoverflow.com/'.$_GET["x"]));?>

Cheers,

Php နဲ့ ဂ်ီေမးပို့နည္း - Sending Email using Gmail from Php (Hello World!)

Php နဲ့ ဂ်ီေမးပို့နည္း Sending Email using Gmail from Php (Hello World!)

$user=$from="valid.gmail.address@gmail.com"
$to="another.valid.gmail.address@gmail.com"
$passwd="valid.gmail.address@gmail.com's password"

require_once 'Mail.php';

$params = array(
'host'=> 'tls://smtp.gmail.com','port'=> 465,'auth'=> true,'debug'  => false,
'username' => $user,
'password' => $passwd
);

$smtp = Mail::factory('smtp', $params);
$smtp->send($to, array('From'=>$from,'To'=>$to), "Hello World!");

# Be Good, Don't be Evil :-)

Cheers,
Mark

Making Extension for Python is easier than PHP especially Unicode Program with C/C++

Making Extension for Python is easier than PHP especially Unicode Program with C/C++

Well, Its take my two holidays to get working Unicode related program on php.

In python, only need gcc or g++ and working great.

but php (tested on php5.2.9), mainly accept the type *char* and need extra library to convert to *wchar_t* type. so I have to write my own unicode-utf8 conversion, escape functions and parsing functions.
And need the program *phpize* to generate configure scripts,
Its only on php source and you need to compile php.
And to compile php,will need very very big library *libxml2* source and compile, its take more time than compiling php.
for C program thats all, but for C++ seems need extra information, I still dont sucess running C++ programs for PHP yet. but its ok so far for me. :-)

Well, I think its still worth to do it :-)

Soe Min

က်ေနာ္ဖတ္ေသာ အျခား ဘေလာ့ / ဆိုဒ္မ်ား