简体   繁体   English

PHP - 提交按钮什么都不做

[英]PHP - Submit button does nothing

I know this has been asked tons of times.我知道这已经被问过很多次了。 But my submit button isn't working on an Email script I have.但是我的提交按钮在我拥有的电子邮件脚本上不起作用。

<?php
if (isset($_REQUEST['email']))

 {

$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;
mail("necro@gophobia.com", $subject,
$message, "From:" . $email);
echo "Thank you for using our mail form";
}
else
 {
 echo "<form method='post' action='http://cogameservers.com/home/contact'>
Email: <input name='email' type='text' /><br />
Subject: <input name='subject' type='text' /><br />
Message:<br />
<textarea name='message' rows='15' cols='40'>
</textarea><br />
<input type='submit' />
</form>";
}
?>

Thanks for any help =]感谢您的帮助 =]


Edit When I say the submit button doesnt work.编辑当我说提交按钮不起作用时。 I mean it does nothing at all.我的意思是它什么都不做。

Check your HTML source code . 检查您的 HTML 源代码 It is completely messed up:它完全搞砸了:

  • there is a second opening <html> tag有第二个<html>开头标签
  • your <head> contains many lines of code that should be placed in <body> instead (such as <div id="loginmodal" class="reveal-modal"> )您的<head>包含许多应该放在<body>的代码行(例如<div id="loginmodal" class="reveal-modal">

The browser does it best to overcome errors, but sometimes it gets lost when there are too many serious errors.浏览器尽最大努力克服错误,但有时当出现太多严重错误时它会丢失。

There are other errors, check what the validator outputs.还有其他错误,请检查验证器输出的内容。 Fix your HTML code, check that the validator is happy, then try again submitting your form.修复您的 HTML 代码,检查验证器是否满意,然后再次尝试提交您的表单。

The correct syntax for conditional comments is explained here . 此处解释了条件注释的正确语法。 In your case it should be:在你的情况下,它应该是:

<!--[if gt IE 8]> <html class="no-js" lang="en"> <!<![endif]-->

But your code currently is:但您的代码目前是:

<!--[if gt IE 8] <html class="no-js" lang="en"> <!--<![endif]-->

Anyway, since there already is an opening <html> tag earlier, it will cause an error: there can be only one <html> tag in the page.无论如何,由于之前已经有一个打开的<html>标签,它会导致错误:页面中只能有一个<html>标签。

Contact line 45 has problems.联络线 45 有问题。 Use in browser debuggers like Firebug and check the console.在 Firebug 等浏览器调试器中使用并检查控制台。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM