Categories
Links PHP

Using PHP to connect to the new Google Blogger API

Check this cool article and give source code if you want to do Google’s Blogger automation using PHP.

Link : http://kosso.wordpress.com/2007/03/01/using-php-to-post-to-the-new-google-blogger-api/

PHP Source Link : http://kosso.co.uk/PHP/blogger_google_secure_AuthSub.phps

Thanks Kosso,

Categories
Bookmarked PHP Programming

Framework for PHP

Hi,

 Nothing much to say just try this framework and let us know your comments on it…

 http://code.google.com/p/tuxicphp/

Thanks to friend AC Sandeep for his efforts.

Categories
Bookmarked PHP Programming

PDF generation through PHP Code

I have use PDF file gets emailed to customer feature in lot of my project. For this we use various PDF generation classes available. But today I am going to talk about absolutely free method of doing this. For this I use  html2pdf  and GhostScript. Just a suberb combination of making PDF on the fly.

I install both of them in my windows XP machine running Apache web server and they give me my blogs screenshot as PDF file with default settings only. What else you want to know about their power. They just get my Online web blog screen shot.

Rating for them is 10 /10.

Categories
Concept/algorithm Operating System PHP

Linux User authentication using PHP

In one of my last post i try to define how linux store its password. Today I will be putting Complete PHP code for it.

Just run it on your local server(mind it your Http server must be running as root user in order to use this script )

Its a raw way of doing password matching and shouldn’t be used for commerical application or servers. its purely Learning script

So here goes the script

6 && CRYPT_MD5 == 1) {
$salts = explode(“$”,”$userlist[1]”);
$salt = “\$1\$”.$salts[2].”\$”;
$gen_password= crypt($password,$salt);
if ($gen_password == $userlist[1]) {
$UserMatch = true;
}
else
{
$UserMatch = false;
}
}
else {
$UserMatch = false;
}
break;
}
}
return $UserMatch ;
}

if (ReadUser(“sumit”) == true)
{
if (MatchPassword(“sumit”,”sumit”) == true )
{
echo “Login successful”;
}
else
{
echo “Login unsuccessful”;
}
}
?>

Hope that helps learn understanding linux passwd and shadow usage.

EDIT: I will update the script sometime sooner maybe!!!

Categories
PHP Server Configuration

Three things to do for File upload using PHP and Apache

Recently I have been ask by a developer to check the Apache configuration as his PHP script is not able to upload files more than 512KB. I looked around with my basic knowledge to see whats the cause of problem. And found these three things need to be modify in order to correctly upload file using PHP with Apache Webserver.

1) Check the php.ini for
upload_max_size it must be greater than what you required for example to upload 10 MB file you need

upload_max_size 10M in PHP.ini

or

php_flag upload_max_size 10M in .htaccess (it will only work if Apache is not using SUExec , not sure why is it so)

2) Check the PHP.ini for post_max_size

in PHP.ini it should be
post_max_size 11M ( as you will be having some text field with your 10 MB file so make space for them, it should always be greater than upload_max_size otherwise you are not able to upload full size files )

3) Its not necessary is set by default. And not sure whats its default value, but if you are getting this error in your Apache Error log

Requested content-length of xxx is larger than the configured limit of xxx, referer: http://www.vikasumit.com

than you need this in your httpd.conf file

<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 11534336
</Files>

this will set the PHP to have upload 11MB of body text, and header is not counted here. Again this must be set great than upload_max_size setting for php.ini

Now you can upload any file upto 10MB on your server.

Enjoy file uploading …

Sumit Gupta