2014-01-17 68 views
0

我有以下Bootstrap模式,我只是提交并最终会发送一封电子邮件。现在我只是想回应注册。提交Modal并运行PHP脚本

  <div class="modal-body"> 
       <form class="form-horizontal" name="commentform" method="post" action="signup.php"> 

        <div class="form-group"> 
         <label class="control-label col-md-4" for="first_name">First Name</label> 
          <div class="col-md-6"> 
           <input type="text" class="form-control" id="first_name" name="first_name" placeholder="First Name"/> 
          </div> 
        </div> 

        <div class="form-group"> 
         <label class="control-label col-md-4" for="last_name">Last Name</label> 
         <div class="col-md-6"> 
          <input type="text" class="form-control" id="last_name" name="last_name" placeholder="Last Name"/> 
         </div> 
        </div> 

        <div class="form-group"> 
         <label class="control-label col-md-4" for="email">Email Address</label> 
         <div class="col-md-6 input-group"> 
          <span class="input-group-addon">@</span> 
          <input type="email" class="form-control" id="email" name="email" placeholder="Email Address"/> 
         </div> 
        </div> 

       </form> 
      </div> 

这里是我的signup.php代码:

<?php 
echo "Signing Up"; 
?> 

然而,当我在我的Dreamhost的服务器上运行此,按注册按钮,没有任何反应都没有。我的控制台提供给我这个错误:没有'Access-Control-Allow-Origin'标题出现在请求的资源上。

回答

0

你的代码对我来说工作正常(在添加Submit按钮之后)。见demo

检查您的文件您的权限,确保PHP文件为644(-rw-R - R--)

+0

我怎样才能做到这一点? – user3147424

+0

从命令行:chmod 644 * php ...从dreamhost文件管理器可能有一个按钮来做到这一点。 – Guy

+0

检查dreamhost,他们是644. – user3147424