UtamaBeritaTutorialBlogTool



Curl and PHP5 on Windows

I am trying to getting Curl to work properly on my Windows. I am getting this error when I try to load the php_curl.dll module:

Fatal error: Call to undefined function curl_init()

To fix this, copy libeay32.dll and ssleay32.dll from PHP\dll folder into c:\windows\system32. Override any existing file. Restart Apache server and this should fix the problem.

Technorati Tags: ,

What caused an error in mysql query?

$query = mysql_query("SELECT * FROM table WHERE table_id = 1", $db);
$content = mysql_fetch_object($query);

The above command will execute the query using the mysql_query(). $query will be true if the query is successfully executed or it will return false. But if the error occured, it just show the arguement is not a valid MySQL result. Use the mysql_error() function to find out what is the real error was:

$query = mysql_query("SELECT * FROM table WHERE table_id = 1", $db)
or die (”Query failed: ” . mysql_error() . ” Actual query: ” . $query);
$content = mysql_fetch_object($query);

Technorati Tags:

How to get blog name

Use the explode() function on URL to get the blog name.

For example: http://blog.ilmuit.com/blogname

$blogname = explode("/", get_bloginfo('url'));
echo $blogname[3];

Technorati Tags: ,

Port Scanner in PHP

This is a very basic port scanner in PHP.

for($port = $from; $port <= $to; $port++)
{
$fp = fsockopen(”$host”, $port);
if ($fp)
{
print(”port $port opened \r”);
fclose($fp);
}

Technorati Tags: ,

I know HTML

HTML

Technorati Tags:

Selamat Datang

Selamat datang ke Blog.ilmuit.com. Ini ialah entri pertama anda. Sunting atau buang entri ini, kemudian mulakan memblog!