Friday, June 13, 2008

In an absolute world

It's the first and last time I am playing blogger games ever and it's because Petya challenged me.

Hmm... let me see what should an absolute world be.

- only MAC computers available
- no managers/team leaders with unworkable requests all the time
- women with no timeframe restrictions for having sex
- free Mazda RX-8 with a full tank on every corder
- unrestricted joint and coffee shops (Deen Haag's affect ... )

And now it's my turn - Evgeni, Genadi show me your worlds. :)

Thursday, May 15, 2008

SWFUpload & Sessions

Have you tried SWFUpload?
It's cool flash uploader which is ideal for uploading big files (over 5-10MB) and having visual status about how much it's left.

Everything seems fine from the demos, etc. but! Yeah there is one clause that I figured out by myself while trying to use the tool in Drupal.
If you want to use the SWFUpload in restricted areas with scripts that require sessions (e.g. cookie sessions) you will fall into the hole.
For solving the issue add session read from $_GET also cause under Safari/Firefox/MAC OS X; Firefox/Linux the SWFUploader won't pass any cookies the the "upload.php" script.

Example solution for drupal:

if (isset($_GET['fmauthsessid']) {
if ($_GET['fmauthsessid']) {
$_COOKIE[session_name()] = $_GET['fmauthsessid'];
$key = $_GET['fmauthsessid'];
}
}
else {
if (!isset($_COOKIE[session_name()])) {
$user = drupal_anonymous_user();
return '';
}
}

Put this in the beginning of sess_read() in includes/session.inc

More experience lessons will be comming these days.

Wednesday, March 12, 2008

Wanna send email to Hotmail.com from PHP mail()? SUX...

Hello everyone,

I know you've noticed that I am not quite often blogging, but I am and will try to post interesting tech stuff here.

Today's topic: Sending email to Hotmail account from PHP.

Sounds easy. Some of will say "just use PHP's mail() function with correct headers". Yeah, but not. :)
I read almost all posts on this topic around the net with no success. So finally I started trying and trying ... after the 5th or 6th hour (God bless I started in the morning of the day else I would probably throw my MacBook out of the window) I managed to send emails to Hotmail successfully!

Hints:
1) Do NOT put any "a href" tags in the email
2) Put ONLY email address in the TO: and FROM: headers of the email
If you do one of the above your email won't even be in the Junk!
3) Do NOT send email from address like: [email protected] or [email protected]
or it will go to Junk! folders in Hotmail accounts

That's it! Enjoy! :)

Ouh, I forgot to mention that I wanted to send HTML emails. ;-)

Friday, January 11, 2008

Looking for Dedicated Hosting Provider?

As many of you may know I do use dedicated server for 3 years by now. I started with MegaNetServe and I was satisfied till the previous year (2007) when they started to have frequently network downtimes with no reason or at least they didn't gave one.

Now I moved to Aplus and I can strongly recommend you them. Becides a value dedicated server you can get Plesk Control Panel with licence for 30 domains for no additional costs, which is great!
Plesk can save you a lot of time configuring the whole machine's services.

No, I haven't experienced a long term partnership with them by guys from MySQL Performance Blog are very pleased with Aplus for years.

Try them - www.aplus.net! ;-)

You will thank me later. :)