Email Validation in javascript

Email Validation in javascript
function isValidEmail(content)
{

valid = false;


var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;


if (filter.test(content)) {
valid=true;
}

return valid;
}

Phone Validate in js

Phone Validate in js
function validatephone(xxxxx) {
  var maintainplus = '';
  var numval = xxxxx.value
  if ( numval.charAt(0)=='+' ){ var maintainplus = '+';}
  curphonevar = numval.replace(/[\\A-Za-z!"£$%^&*+_={};:'@#~,¦\/<>?|`¬\]\[]/g,'');
  xxxxx.value = maintainplus + curphonevar;
  var maintainplus = '';
  xxxxx.focus;
}

Disable the drag-to-expand feature for textarea

In css
textarea {
  resize: none;
}
You could also set this programmatically by using jQuery:
// CSS
textarea.no-expand {
  resize: none;
}

// jQuery
$('#my-text-area').addClass('no-expand');

Refresh uploading image in preview




PHP Application Debugging


One of the best places to look for errors is in the server logs, if you have access to them. That depends on your host.

For PHP you can insert the following code at the beginning of your file:

error_reporting(E_ALL);

ini_set('display_errors','on');

Everything that goes to the server log will also show up on your web page. Be sure to remove this ASAP as it could be annoying to general readers and it could give away key information.


Another good trick is to use echo/alert statements in key parts of your code to give you an idea of what is going on. (You could also create a log file on your server, but that's getting pretty elaborate). Again, remove ASAP.

A word of caution with the use of echo in PHP. Some PHP processing is messed up when there's anything sent to the browser before it finished. Doing things with headers, for instance. That goes south with any output.

Sending HTML Email with PHP

this simple code lines will help you sending html email.

//change this to your email.
$to="name@domain.com";

$subject='Hello! This is Sending   HTML email';  
$message="

  
    
I am reciving HTML email......
Thanks Ramesh!


Now you Can send HTML Email
Regards
Ramesh Thanneeru "; $headers = "From: info@domain.com\r\n"; //options to send to cc+bcc $headers .= "Cc: email@domain.com"; $headers .= "Bcc: email@domain.com"; $headers .= "Reply-To: email@domain.com\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; mail($to, $subject, $message, $headers);