Php 联系方式不起作用

Php 联系方式不起作用,php,html,forms,email,Php,Html,Forms,Email,我无法使此联系表工作,不确定它是什么,将非常感谢您的帮助。代码如下: <?php //Process Contact if (isset ($_POST['send'])) { //Variables $name=$_POST['name']; $email=$_POST['email']; $message=$_POST['message']; //Check all the inputs if ($name!='' && $email!='' && $

我无法使此联系表工作,不确定它是什么,将非常感谢您的帮助。代码如下:

<?php
//Process Contact
if (isset ($_POST['send'])) {
//Variables
$name=$_POST['name'];
$email=$_POST['email'];
$message=$_POST['message'];

//Check all the inputs
if ($name!='' && $email!='' && $message!='') {
// then Html
$contenido = '<html><body>';
$contenido .= '<h2>Contact from</h2>';
$contenido .= '<p>Sent: '.  date("D M Y").'</p>';
$contenido .= '<p>Name: <strong>'.$name.'</strong>';
$contenido .= '<p>Email: <strong>'.$email.'</strong>';
$contenido .= '<p>Message: <strong>'.$message.'</strong>';
$contenido .= '<hr />';
$contenido .= '</body></html>';

// If the forms are full, it shows the message
mail ("mj@marijoing.com", "Mother-Well", $contenido, "From: $email\nContent-Type:text/html; charset=iso-8859-1\nContent-Transfer-Encoding: 8bit"); 
$flag='MessageSuccess';
$mensaje='<div class="MessageSuccess">Your message has been sent, we will contact you shortly .<br/><strong>Thank you!</strong> </div>';

} else {
//If there's a from to fill...  
$flag='err';
$mensaje='<div class="MessageError">All the information in the entry form are required.     Please, try again</div>';
}
}
?>

And the HTML:

<? echo $mensaje; /*Status form */ ?>
<? if ($flag!='MessageSuccess') { ?>
<form action="contact.php" method="post"> 
<input <? if (isset ($flag) && $_POST['name']=='') { echo 'class="MessageError"';}?> type="text" value="<? echo $_POST['name'];?>" maxlength="40" /><br />
<input <? if (isset ($flag) && $_POST['email']=='') { echo 'class="MessageError"';} ?>     type="text" value="<? echo $_POST['email'];?>" maxlength="40" /><br />               
<textarea <? if (isset ($flag) && $_POST['message']=='') { echo 'class="MessageError"';}     ?> name="message" rows="4"><? echo $_POST['message'];?></textarea><br />
<input type="submit" value="CONTACT US" name="send" />
</form>

<? } ?>

Hope somebody can help me, thanks in advance :)

这绝不是唯一可能的错误,但您确实会这样做

<? if ($flag!='MessageSuccess') { ?>
<form action="contact.php" method="post"> 
<input <? if (isset ($flag) 
而不是

<?

什么不起作用了,它有错误吗?。。。不要只是给出代码并寻求帮助,然后说这不起作用,我们不想为你调试整个代码。你能使用
对不起,阿蒂斯·巴罗斯吗,如果你这么小气的话,不要麻烦帮我。。也许我问错了。。但我可以有第二次机会吗?问题是contcat表单不起作用,当我试图发送和发送电子邮件时,错误消息说:输入表单中的所有信息都是必需的。请再试一次。。但是我已经输入了所有的代码。也许错误就在调用这个的表单中。你能做一个
print\r($\u POST)吗显示调用此脚本时设置的所有值?感谢您的帮助!:)你有进步吗?你试过我的建议了吗?当你
print\r($\u POST)时,你会得到什么?我让它工作!。。我发现参数name=“name”丢失,因此现在正在工作,谢谢您的帮助!
<?