Search results for 'PHP'. 50 post(s) found.
- 2009/11/27 PHP function converts new line to BR tag
- 2009/10/19 PHP socket programming to get content with post method
- 2009/08/05 How to remove HTML tags in text string?
- 2008/10/01 How to delete file on certain path ?
- 2008/09/23 ASCII Artwork Generator from image file
- 2008/04/14 How to limit by Timeout when opening URL ?
- 2008/03/31 How to put timeout when opening URL by fopen ?
- 2008/02/28 How to convert W3C Date Time Format ?
- 2008/02/24 Get the actual filesize for a size above 2GB in Windows
- 2008/02/13 ISO 8601 format time format string conversion
PHP provides to get Browser Information by function. Below is the simple example.
Above example may display as following, if you use FireFox.
Mozilla/5.0 (Windows; U; Windows NT 5.1; ko; rv:1.9.2.3) Gecko/20100401
Firefox/3.6.3 ( .NET CLR 3.5.30729)
In order to get above variable on function, you need to declare on top of the function as below.
Another posts included in "PHP"
| PHP function converts new line to BR tag (0) | 2009/11/27 |
| PHP socket programming to get content with post method (0) | 2009/10/19 |
| How to remove HTML tags in text string? (0) | 2009/08/05 |
| How to delete file on certain path ? (0) | 2008/10/01 |
| ASCII Artwork Generator from image file (0) | 2008/09/23 |
Trackback : Cannot send a trackbact to this post.
In case of displaying normal text having CR+LF character string on web browser, you may need to change it to <BR> tag.
PHP provides speedy converting function for supporting that. Following function is very useful.
Proto-type:
function nl2br( <source string> )
function nl2br( <source string> )
As you can expect by function name, it converts new line character set to <BR> tag.
Another posts included in "PHP"
| How to get browser information in PHP? (0) | 2010/06/22 |
| PHP socket programming to get content with post method (0) | 2009/10/19 |
| How to remove HTML tags in text string? (0) | 2009/08/05 |
| How to delete file on certain path ? (0) | 2008/10/01 |
| ASCII Artwork Generator from image file (0) | 2008/09/23 |
| How to limit by Timeout when opening URL ? (0) | 2008/04/14 |
Trackback : Cannot send a trackbact to this post.
-
Subject Phentermine cheap.
2010/05/28 16:31
Phentermine cheap. Buy cheap phentermine online. Cheap phentermine online. Cheap phentermine cod. Cheap phentermine diet pill.
When you need to get content with POST Method in PHP internal code, you need to get the desired result through alternate Socket Programming as below.
Actualluy what I wanted is emailing through alternate server located in different domain, because the current server has some limitation.
Following code is implemented at caller server.
<?
// caller page : kmail.php
// programmed by Super Coder / Chunun Kang (kurapa@kurapa.com)
function kmail( $recipient, $subject, $body)
{
$host = "foo.com";
$uri = "/api/kmail_api.php";
// acutally security code is removed on below code.
// you can add it by yourself.
$reqbody = "s=" . urlencode($subject)
. "&b=" . urlencode($body)
. "&f=" . urlencode('SAMSUNGDForum')
. "&h=" . urlencode($headers)
. "&r=" . urlencode($recipient);
$contentlength = strlen($reqbody);
$reqheader = "POST $uri HTTP/1.0\xd\xa".
"Host: $host\xd\xa". "User-Agent: Mozala\xd\xa".
"Content-Type: application/x-www-form-urlencoded\xd\xa".
"Content-Length: $contentlength\xd\xa\xd\xa".
"$reqbody\xd\xa";
$socket = fsockopen($host, 80, $errno, $errstr);
if (!$socket)
{
$result["errno"] = $errno;
$result["errstr"] = $errstr;
return $result;
}
fputs($socket, $reqheader);
while (!feof($socket))
{
$result[] = fgets($socket, 4096);
}
fclose($socket);
return $result;
}
?>
// caller page : kmail.php
// programmed by Super Coder / Chunun Kang (kurapa@kurapa.com)
function kmail( $recipient, $subject, $body)
{
$host = "foo.com";
$uri = "/api/kmail_api.php";
// acutally security code is removed on below code.
// you can add it by yourself.
$reqbody = "s=" . urlencode($subject)
. "&b=" . urlencode($body)
. "&f=" . urlencode('SAMSUNGDForum')
. "&h=" . urlencode($headers)
. "&r=" . urlencode($recipient);
$contentlength = strlen($reqbody);
$reqheader = "POST $uri HTTP/1.0\xd\xa".
"Host: $host\xd\xa". "User-Agent: Mozala\xd\xa".
"Content-Type: application/x-www-form-urlencoded\xd\xa".
"Content-Length: $contentlength\xd\xa\xd\xa".
"$reqbody\xd\xa";
$socket = fsockopen($host, 80, $errno, $errstr);
if (!$socket)
{
$result["errno"] = $errno;
$result["errstr"] = $errstr;
return $result;
}
fputs($socket, $reqheader);
while (!feof($socket))
{
$result[] = fgets($socket, 4096);
}
fclose($socket);
return $result;
}
?>
In addition you need to add following callee PHP page on your callee server.
<?
// callee page : /api/kmail.php
// programmed by Super Coder / Chunun Kang (kurapa@kurapa.com)
$title = '=?utf-8?b?'.base64_encode($s).'?=';
$recipient = $r;
if (strlen($h)<1)
{
if (strlen($f)>0)
{
$h = "From: $f <no-reply@foo.com>\r\n";
}
else
{
$h = "From: NO-REPLY <no-reply@foo.com>\r\n";
}
$h .= "X-Sender: no-reply@foo.com\r\n";
$h .= "X-Mailer: Mozala PHP ".phpversion()."\n";
}
mail($recipient , $title, $b, $h);
?>
// callee page : /api/kmail.php
// programmed by Super Coder / Chunun Kang (kurapa@kurapa.com)
$title = '=?utf-8?b?'.base64_encode($s).'?=';
$recipient = $r;
if (strlen($h)<1)
{
if (strlen($f)>0)
{
$h = "From: $f <no-reply@foo.com>\r\n";
}
else
{
$h = "From: NO-REPLY <no-reply@foo.com>\r\n";
}
$h .= "X-Sender: no-reply@foo.com\r\n";
$h .= "X-Mailer: Mozala PHP ".phpversion()."\n";
}
mail($recipient , $title, $b, $h);
?>
Finally what you need to do is including above caller page to call kmail function.
include "./kmail.php";
kmail( "foo@foo.com", "howdy?", "test message from Chunun Kang (kurapa@kurapa.com");
kmail( "foo@foo.com", "howdy?", "test message from Chunun Kang (kurapa@kurapa.com");
Another posts included in "PHP"
| PHP function converts new line to BR tag (0) | 2009/11/27 |
| How to get browser information in PHP? (0) | 2010/06/22 |
| How to remove HTML tags in text string? (0) | 2009/08/05 |
| How to delete file on certain path ? (0) | 2008/10/01 |
| ASCII Artwork Generator from image file (0) | 2008/09/23 |
| How to limit by Timeout when opening URL ? (0) | 2008/04/14 |
| How to put timeout when opening URL by fopen ? (0) | 2008/03/31 |
Trackback : Cannot send a trackbact to this post.
strip_tags() function is the simplest & fast PHP function to remove HTML Tags in text string.
Here's the simple example.
$m_school = strip_tags( $m_school);
Another posts included in "PHP"
| PHP socket programming to get content with post method (0) | 2009/10/19 |
| PHP function converts new line to BR tag (0) | 2009/11/27 |
| How to get browser information in PHP? (0) | 2010/06/22 |
| How to delete file on certain path ? (0) | 2008/10/01 |
| ASCII Artwork Generator from image file (0) | 2008/09/23 |
| How to limit by Timeout when opening URL ? (0) | 2008/04/14 |
| How to put timeout when opening URL by fopen ? (0) | 2008/03/31 |
| How to convert W3C Date Time Format ? (0) | 2008/02/28 |
Trackback : Cannot send a trackbact to this post.
The file deletion function is really simple. It's exactly the same with C function.
Following is the example.
Unlink( 'c:/hello.world.txt');
Another posts included in "PHP"
| How to remove HTML tags in text string? (0) | 2009/08/05 |
| PHP socket programming to get content with post method (0) | 2009/10/19 |
| PHP function converts new line to BR tag (0) | 2009/11/27 |
| ASCII Artwork Generator from image file (0) | 2008/09/23 |
| How to limit by Timeout when opening URL ? (0) | 2008/04/14 |
| How to put timeout when opening URL by fopen ? (0) | 2008/03/31 |
| How to convert W3C Date Time Format ? (0) | 2008/02/28 |
| Get the actual filesize for a size above 2GB in Windows (0) | 2008/02/24 |
Trackback : Cannot send a trackbact to this post.
-
Subject Animal sex dvd.
2009/02/12 12:32
Animal sex videos. Free animal sex video. Free animal sex. Askjolene com gay animal sex.
-
Subject Lesbian incest.
2009/03/12 11:11
Young incest stories. Incest porn. Incest story.
-
Subject Vicoden valium.
2009/06/14 13:31
Valium side effects. Valium picture. Cheap valium. What does valium look like. Valium. Valium without prescription.
Prev


Rss Feed