php
Archived Posts from this Category
Archived Posts from this Category
While you can check syntax of an email address (valid format) but can’t validate the existence of an email address without checking with the email domain name.
The PHP class encapsulates the SMTP transation between the remote domain, as well as the DNS lookup for the Mail Transfer Agent (MTA) responsible for that domain.
The class can take a number of email addresses, and return whether they are valid or not. It will group together emails with the same domain, and create a single SMTP connection to the MTA for those emails for efficiency.
Example usage
// include SMTP Email Validation Class
require_once('smtp_validateEmail.class.php');
// the email to validate
$email = 'user@example.com';
// an optional sender
$sender = 'user@mydomain.com';
// instantiate the class
$SMTP_Validator = new SMTP_validateEmail();
// turn on debugging if you want to view the SMTP transaction
$SMTP_Validator->debug = true;
// do the validation
$results = $SMTP_Validator->validate(array($email), $sender);
// view results
echo $email.' is '.($results[$email] ? 'valid' : 'invalid')."\n";
// send email?
if ($results[$email]) {
//mail($email, 'Confirm Email', 'Please reply to this email to confirm', 'From:'.$sender."\r\n"); // send email
} else {
echo 'The email addresses you entered is not valid';
}
Reference : http://code.google.com/p/php-smtp-email-validation/
0 comments Tuesday 24 Apr 2012 | BestHosting | email, php, tutorial
PHP Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 8193 bytes) in ….
looks familiar ? This memory limit is dependent on settings inside your php.ini file(which should be inside public_html, if you have created one).
You can change it by editing line 232 in your php.ini file. I would change it to read as such:
memory_limit = 64M
If you haven’t created a php.ini before, follow these steps:
1. Login to cPanel.
2. Click on PHP Config from the Software / Services section.
3. Select PHP5 (Single PHP.INI).
4. Click Save Changes.
5. On this same screen, select IONCube, and click ‘Install PHP.INI Master File’.
6. Go back to the cPanel.
7. Click on ‘File Manager’ from the Files section.
8. Select Webroot and click go.
9. Find php.ini.default and rename it to: php.ini
10. Select the php.ini file and click ‘Code Edit’.
11. Click ‘Edit’ in the lower right hand corner.
12. Scroll to line number 232.
13. Change line 232 to read as such:
memory_limit = 64M
14. Click ‘Save Changes’ (upper right hand corner).
You should now be able to perform operations that require more than 32 megabytes.
0 comments Friday 05 Feb 2010 | BestHosting | php, support
I received this email from Reseller club
Hello,
Keeping up with our promise of providing you with the safest hosting environment, we have to make a few changes to our PHP installation on our Linux Hosting Servers. We will be disabling a few PHP functions that allow users to execute system commands on the servers that disclose system information in a shared hosting environment. These functions are sparingly required by clients and are more of a security threat to your websites.
The functions that will be deprecated are:
system, shell_exec, exec, passthru, php_uname, popen, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, posix_setgid, posix_uname, proc_close, proc_nice, proc_open, proc_terminate
We will be making these changes on Friday, 27th of November, 2009. If you are using these functions in your PHP scripts, you will have to inform your customers accordingly about these changes.
Your co-operation is highly appreciated.
Regards,
Team ResellerClub
0 comments Tuesday 17 Nov 2009 | BestHosting | news, php, security