/    Sign up×
Community /Pin to ProfileBookmark

I have a contact form that uses mootools to generate an inline message.

When I set the contact form up on its own, it works great… but when I drop it into the page (same exact paths) it [B]a)[/B] doesn’t keep inline [B]b)[/B] when validating never returns TRUE.
[B]
For example:[/B]

[I]
This one works:[/I]

[url]http://www.jxmckenzie.com/grandmothersHTML2/smallForm.php[/url]

[I]This one doesn’t work(in the header):[/I]
[url]http://jxmckenzie.com/grandmothersHTML2/about.php[/url]

[B]This is the PHP:[/B]

[code=php]<?php
error_reporting(E_NOTICE);

function valid_email($str)
{
return ( ! preg_match(“/^([a-z0-9+_-]+)(.[a-z0-9+_-]+)*@([a-z0-9-]+.)+[a-z]{2,6}$/ix”, $str)) ? FALSE : TRUE;
}

if($_POST[‘e_mail’]!=” && valid_email($_POST[‘e_mail’])==TRUE)
{
$to = ‘[email protected]’;
$headers = ‘From: ‘.$_POST[‘e_mail’].”. “rn” .
‘Reply-To: ‘.$_POST[‘e_mail’].” . “rn” .
‘X-Mailer: PHP/’ . phpversion();
$subject = “Hello! Somebody has signed up for your Mailing List”;
$message = ‘The following email address should be added to your mailing list’.’ ‘.$_POST[‘e_mail’];

if(mail($to, $subject, $message, $headers))
{
echo ‘Thanks, you have been added to the mailing list’;
}
else {
echo “Error. Message not sent.”;
}
}
else {
echo ‘Please make sure that you entered a valid email.’;
}
?> [/code]

Any ideas? Thanks!

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@brunoaisJul 06.2009 — Unix doesn't use rn for a new line but I don't know if ti accepts.

besides that I have no idea
×

Success!

Help @talkingAnimals spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...