‘Many countries, or even parts of countries, adopt daylight saving time (DST, also known as “Summer Time”) during part of the year. This typically involves advancing clocks by an hour near the start of spring and adjusting back in autumn (“spring” forward, “fall” back).’ (see Wikipedia) Now I will demonstrate how we can convert a [...]
Full error message: SoftException in Application.cpp:544: Directory “/path/to/directory” is writeable by group The error apeared in cpanel logs at a hosting company and was related to a directory I created via ftp and where I tried to run some php script. When accessing the script from the web browser i got the error “500 Internal [...]
If you submit a PHP form which passes a large amount of data using the POST method, like a file upload form, it would be a good idea to increase the value of the PHP configuration variable post_max_size (you will find it in the php.ini file) if it seems like the script is running forever. [...]
I tried moving all my databases from MySQL 4.1 to MySQL 5.1 on Windows and since I had some InnoDB tables I could not just copy the data files between MySQL Server versions (from C:\Documents and Settings\All Users\Application Data\MySQL\MySQL 4.1\data\ to C:\Documents and Settings\All Users\Application Data\MySQL\MySQL 5.1\data\). So, after I exported the data from the [...]
This happens because of output_buffering is on. In order to turn off output buffering modify php.ini if you have access and set: output_buffering = Off or add in the local directory a .htaccess file containing this line: php_value output_buffering Off # or 0
This error occurs on any operating system (windows, linux). The problem is that instead of getting a sql file with the database data you get a empty (0 kb.) file. So we have the following code: $command = “mysqldump –opt –skip-extended-insert –complete-insert -h “.$DB_HOST.” -u “.$DB_USER.” -p “.$DB_PASS.” “.$DB_NAME.” > backup.sql”; exec($command, $ret_arr, $ret_code); echo [...]
I wanted to send an email that only contained an attachment as follows: $headers = “MIME-Version: 1.0\r\n”; $headers .= “To: <”.$to_email.”>\r\n”; $headers .= “From: “.$from_name.” <”.$from_email.”>”; $random_hash = md5(date(‘r’, time())); // add boundary string and mime type specification $headers .= “\r\nContent-Type: multipart/mixed; boundary=\”PHP-mixed-”.$random_hash.”\”"; // read the atachment file contents from a string previously formed, // [...]
Problem: Using specific characters from European languages like Romanian, Bulgarian, Czech and so on (usually the ones without support in ISO 8859-1) rises errors when displaying the content in browsers turning special characters in unrecognizable ones. My fix for this problem is using UTF-8 character set encoding for every page of the website and the [...]
I could not receive a failure notice when sending email to an email address that does not exist ($to_address), using this code: $subject = “Email subject”; $message = “line1\r\nline2\r\nline3″; $headers = “MIME-Version: 1.0\r\n”; $headers .= “Content-type: text/plain; charset=iso-8859-1\r\n”; $headers .= “To: <$to_email>\r\n”; $headers .= “From: Me <$my_email_address>\r\n”; $headers .= “Return-Path: <$my_return_email_address>r\n”; mail($to_email, $subject, $message, $headers); [...]
Full error message: Warning: mail(): SMTP server response: 451 See http://pobox.com/~djb/docs/smtplf.html. in path_to_php_file on line # This is an error message that I got lots of times and it was always the same problem. So I decided to write here the solution for the next time I encounter it and I thought it might also [...]
