hey
I need help with my mail script
when the form on http://www.mcgdesignstudio.com/contact.html is filled out, it send the from with no errors.. however i never receive it..
my hosting company have told me as long as i have the fourth element in if -f or something it will work, dunno where to put that though..
this is my script:
Code: <?php
if(!$_POST) exit;
$email = $_POST['email'];
//$error[] = preg_match('/b[A-Z0-9._%-]+@[A-Z0-9.-]+.[A-Z]{2,4}b/i', $_POST['email']) ? '' : 'INVALID EMAIL ADDRESS';
if(!eregi("^[a-z0-9]+([_\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([.-][a-z0-9]+)*)+"."\.[a-z]{2,}"."$",$email )){
$error.="Invalid email address entered";
$errors=1;
}
if($errors==1) echo $error;
else{
$values = array ('name','email','message');
$required = array('name','email','message');
$your_email = "martin@mcgdesignstudio.com";
$email_subject = "New Message: ".$_POST['subject'];
$email_content = "new message:n";
foreach($values as $key => $value){
if(in_array($value,$required)){
if ($key != 'subject' && $key != 'company') {
if( empty($_POST[$value]) ) { echo 'You need to fill in all the required fields...'; exit; }
}
$email_content .= $value.': '.$_POST[$value]."n";
}
}
if(mail("$your_email", "$email_subject", "$email_content",
"To: Martin Greenwood <$your_email >n" .
"From: mcgdesignstudio.com <martin@mcgdesignstudio.com>n" .
"MIME-Version: 1.0n" .
"Content-type: text/html; charset=iso-8859-1"
)){
echo 'Your message has been sent successfully..';
} else {
echo 'Oops, something went wrong...try again later.';
}
}
?>
Inserting a check in checkbox from array value
Hello all,I have a bit of code that works for a select option box, but does not work for my checkboxes. I need multiple selections on this code and I really don't like the look of multiple select
Insert numbers from Barcode scanner into online php page
I have a real big problem, Here is what I'm trying to do. I have a Intermec CN3 handheld computer that has a builtin scanner. We have built a website that manage our inventory. How? We have a simple
Help with looping
I have a comma separated list of colors taken from a database ($ICo) and a directory of images named "color". The images are named the "color.jpg"I am attempting to loop through
Request-URI Too Large
I have created a simple submit form for a mysql database that puts a piece of code into database.But if I want to put a document of any decent length, eg. 500 characters (I guess), I get the error
More pug propaganda.
http://www.youtube.com/watch?v=8Kkrmubsgf8The commercial is definitely worth watching pug awesomeness.I'm sure none of you have seen it as it recently came out (About 4 months ago). Pugs can surf,
Batch update record with Pagination
Hoping someone can help me with this issue I'm having, im trying to batch update records from a result set with pagination. The first page results (first 10 records) will update with the batch, but
PHP code needed to get/post form fields and request mysql query results.
I'm new to PHP I've created an html form to allow the user to request a basic telephone directory listing. They can select their 'listtype' by 'all' or by 'state'. If they choose 'state' then they
Fetching META TAGS through
Hello everybodyI want to fetch meta tags of a domain.It will be done from following code of index.phpCode: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
Anti Spam Code Problems
Ok where do i start? Probably by telling you I have very little working knowledge of PHP and that I have been working on this problem for 3 days and have had no luck!Here we go:I have a rate and
ob_ dynamic content
i was wondering about the potential to use ob to create a <div then remove it when the page has finished loading? ie loading cover.