Entries Tagged as 'Programming'

The missing 5th parameter for PHP Mail()

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

So happy!!! Finally I solved my php email script problem for sending emails to server with SPF record!!!

There is a missing 5th parameter for PHP Mail() which I never know (eventhough on php.net mail() function did show up 5th parameter).

My problems is no matter on which site I setup mail scripts, the Return-path always showing the main server url which most of the time causing problem for sending email to some protected email server. No matter how I set the headers to include Reurn-path to any email address, it will never show up the correct one. At last now I have the solution,

mail($to, $subject, $bodymessage, $headers, “-fnoreply@domain.com”)

noreply@domain.com is the address I sepcified, there must be a -f in front of the address.

Hope this will be helpful ;)

CSS z-index trick for IE6 and IE7

Just found out that if you have sort of CSS drop down menu, sometime when the menu drop and touch the bottom DIV, the menu will be cut off.

The solution is very simple, let say your drop down menu #menu is within #header part, you just need to set the #header with z-index:2;

then your next part maybe #contents, this should be set to z-index:1;

Hope you got it ;)

is your Web Server hacked to be a SPAM server?

This morning I just found that my cPanel server sent me a notice by email saying there is a new uploaded CGI/script file trying to use the sendmail function. The file is data_.php

This related to one of my website that I have not been updating recently, so I quickly ftp into my server and check it.

I found that this data_.php script is use for GETTING HTTP POSTS from some where and then it will MAIL it out, so, my server will become the email server for the SPAMMER. Luckily I notice about it earlier now and saw this stupid spammer write different php style than me, so I can sure this is not the script that I wrote for myself (lol, I have to deal with thousand of scripts always)

I have report this to the datacentre admin, they are checking for me now that whether where is the security hole. Stay tuned!!

Access denied for user to database?

Now I am dealing with a weird problem met on my client server where some of the PHP/MySQL codes seems not running correctly. Is it the version problem? I am still searching for the solution. It seems that the codes runing perfectly on my local server and the servers in datacentre. Why don’t those software keep standardized? This is why also I trust the web applications more than a typical software, at least I can keep cross-platform easy and simple.