PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > Contact php form for web
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Contact php form for web

Réponse
 
LinkBack Outils de la discussion
Vieux 17/02/2008, 23h48   #1
2007
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Contact php form for web

Hi

I have a web page running.
One thing is not working on it.
It is not sending the emails from the web,

I have the following entry in the *.php file - what is wrong with it?

mail("abc7@gmail.com ","Contact",stripslashes($msg), $mailheaders);

Please ee below for the full form.

Thanks

<?
// THIS IS THE BEGIINNING OF THE PHP CODE

$name = $_POST['name'];
$country = $_POST['country'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$comments = $_POST['comments'];
$error_msg="";
$msg="";

if(!$name){
$error_msg .= "Your name \n";
}
if($name){
$msg .= "Name: \t $name \n";
}

if(!$country){
$error_msg .= "Your country \n";
}
if($country){
$msg .= "Country: \t $country \n";
}

if(!$phone){
$error_msg .= "Your phone \n";
}
if($phone){
$msg .= "Phone: \t $phone \n";
}

if(!$email){
$error_msg .= "Your email \n";
}
if($email){
if(!eregi("^[a-z0-9_]+@[a-z0-9\-]+\.[a-z0-9\-\.]+$", $email)){
echo 'That is not a valid email address. Please<a
href="javascript:history.back()"> return </a> to the previous page
and try again.';
exit;
}
$msg .= "Email: \t $email \n";
}

if(!trim($comments)){
$error_msg .= "Your comments \n";
}
if($comments){
$msg .= "Comments: \t $comments \n";
}
$sender_email="";

if(!isset($name)){
if($name == ""){
$sender_name="noisevx.com Customer";
}
}else{
$sender_name=$name;
}
if(!isset($email)){
if($email == ""){
$sender_email="customer@noisevx.com";
}
}else{
$sender_email=$email;
}
if($error_msg != ""){
echo"You didn't fill in these required fields:<br>"
. nl2br($error_msg) .'<br>Please <a
href="javascript:history.back()"> return </a> to the'
." previous page and try again.";
exit;}
$mailheaders = "MIME-Version: 1.0\r\n";
$mailheaders .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$mailheaders .= "From: $sender_name <$sender_email>\r\n";
$mailheaders .= "Reply-To: $sender_email <$sender_email>\r\n";
mail("abc7@gmail.com ","Contact",stripslashes($msg), $mailheaders);
header("Location: http://www.xxx.com/index.html"); /* Redirect browser
*/
//THIS IS THE END OF THE PHP CODE ?>
  Réponse avec citation
Vieux 21/02/2008, 19h42   #2
Mason Barge
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Contact php form for web


"2007" <FW3006@sbcglobal.net> wrote in message
news:87030ef9-d7fe-4b55-9874-902dc404623f@s37g2000prg.googlegroups.com...
> Hi
>
> I have a web page running.
> One thing is not working on it.
> It is not sending the emails from the web,
>
> I have the following entry in the *.php file - what is wrong with it?
>
> mail("abc7@gmail.com ","Contact",stripslashes($msg), $mailheaders);
>
> Please ee below for the full form.
>
> Thanks


Since nobody else has responded (and I'm no expert) -

My guess is that you can't have a function in the parameters. Try

$msg=stripslashes($msg);
mail("abc7@gmail.com ","Contact",$msg, $mailheaders);


  Réponse avec citation
Vieux 23/02/2008, 09h06   #3
Martin Mandl - m2m tech support
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Contact php form for web

> > mail("a...@gmail.com ","Contact",stripslashes($msg), $mailheaders);
>
> Since nobody else has responded (and I'm no expert) -
>
> My guess is that you can't have a function in the parameters. Try
>
> $msg=stripslashes($msg);
> mail("a...@gmail.com ","Contact",$msg, $mailheaders);


Dear Mason,

normally you can have a function in the parameters. I suppose nobody
answered, because they would have to guess, since the original poster
gave no error messages, and did not describe the environment the
script is running in. Most likely there is no mail support installed
e.g. if it is a windows machine.

Cheers
Martin

------------------------------------------------
online accounting on bash bases
Online Einnahmen-Ausgaben-Rechnung
http://www.ea-geier.at
------------------------------------------------
m2m server software gmbh
http://www.m2m.at
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 23h26.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11317 seconds with 11 queries