/    Sign up×
Community /Pin to ProfileBookmark

mail contact form opens in it’s own window

Hi everybody

I have uploaded a simple formmail.php on my site.
———————————————————————————–

<?php

// your email address
$youremail = “[email protected]“;

// field validation
if ($email==”” || $comments==”” || $name==””)

{
print (“All fields are required! Please go back and try again.”);
}

else {

// email validation
if(!eregi(‘^([._a-z0-9-]+[._a-z0-9-]*)@(([a-z0-9-]+.)*([a-z0-9-]+)(.[a-z]{2,3})?)$’, $email)) {
print (“Your email address does not appear to be valid. Please go back and try again.”);
exit;
}

// send email
$headers = “From: “$name” <$email>n”;
$subject = “Feedback Form”;
$message = “$comments”;

mail (“$youremail”, “$subject”, $message, $headers);
print (“Thank you $name, your email has been sent to Bicester Town.”);

}

?>
———————————————————————————-

I have a 2 contact forms in 2 of my pages:

1) [url]http://www.bicestertown.co.uk/2-INDEX/contact.htm[/url]
2) [url]http://www.bicestertown.co.uk/advertise-rating-subscribe/subscribe.htm[/url]

Both forms use the same php file (formmail.php)

The problem here is that form number 1) doesn’t send emails. I get the confirmation page but it doesn’t send any emails. Also, it opens the confirmation page in its own window. (a new window) The code is the same as I am using the same code for both. Why one of them sends emails and the other one doesn’t?

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@bokehSep 01.2005 — 
Both forms use the same php file (formmail.php)

The problem here is that form number 1) doesn't send emails. I get the confirmation page but it doesn’t send any emails. Also, it opens the confirmation page in its own window. (a new window) The code is the same as I am using the same code for both. Why one of them sends emails and the other one doesn’t?[/QUOTE]
Whatever the problem is it has nothing to do with the code you posted. Maybe if you post the two html pages someone might be able to spot the problem.
Copy linkTweet thisAlerts:
@PERFECTGREENEYEauthorSep 01.2005 — yes, you are right.

here they are?the codes)

1)working one
[code=php]
<TABLE id=table1
style="BORDER-COLLAPSE: collapse"
borderColor=#111111 cellSpacing=0 cellPadding=0
width="100%" border=0><TR><TD width="86%">
<form action="formmail.php" method="post"><input type="text" name="name"><font color="#666666" face="Verdana" style="font-size: 8pt; font-weight: 700">Name</font><br><input type="text" name="email"><font color="#666666" face="Verdana" style="font-size: 8pt; font-weight: 700">E-mail<br><br>Your Suggestion/Opinion</font><br>
<textarea name="comments" style="width: 325; height: 83" cols="50" rows="10"></textarea><br><INPUT type=submit value=Submit name=submit style="width: 50; height: 20"></form></TR></TABLE>
[/code]


2) not working one:

[code=php]
<TABLE id=table1
style="BORDER-COLLAPSE: collapse"
borderColor=#111111 cellSpacing=0 cellPadding=0
width="99%" border=0><TR><TD width="99%">
<form action="formmail.php" method="post"><input type="text" name="name"><font color="#666666" face="Verdana" style="font-size: 8pt; font-weight: 700">Name</font><br><input type="text" name="email"><font color="#666666" face="Verdana" style="font-size: 8pt; font-weight: 700">E-mail<br><br>Your Suggestion/Opinion</font><br>
<textarea name="comments" style="width: 325; height: 83" cols="50" rows="10"></textarea><br><INPUT type=submit value=Submit name=submit style="width: 50; height: 20"></form></TR></TABLE>
[/code]


Thank you.

p.s.

i still believe that issue has something related to the fact the the not working one opens a new page after i click submit button.
Copy linkTweet thisAlerts:
@bokehSep 01.2005 — So what's the difference between the two? I can't tell because tables make me go blind. And why don't you try posting your code between PHP tags so it is readable.
Copy linkTweet thisAlerts:
@PERFECTGREENEYEauthorSep 02.2005 — there is no difference between them two. i don't know why is not working. ?
Copy linkTweet thisAlerts:
@PERFECTGREENEYEauthorSep 02.2005 — sorted. thanks a lot everybody
×

Success!

Help @PERFECTGREENEYE 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 5.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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