我是Javascript和PHP的新手,我目前正在阅读以下教程。
http://www.html-form-guide.com/php-form/php-form-tutorial.html
不幸的是,当我点击提交时,正在下载myform.php文件而不是运行。有什么我想念的吗?
<?php
if($_POST['formSubmit'] == "Submit")
{
$varMovie = $_POST['formMovie'];
$varName = $_POST['formName'];
}
?>
HTML代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Example</title>
</head>
<body id="main">
<section id='ex'>
<form action="myform.php" method="post">
Which is your favorite movie?
<input type="text" name="formMovie" maxlength="50" value="<?=$varMovie;?>">
What is your name?
<input type="text" name="formName" maxlength="50" value="<?=$varName;?>">
<input type="submit" name="formSubmit" value="Submit">
</form>
</section>
test.php的
?php
phpinfo();
?>