dongse5528 2015-04-21 01:47
浏览 45

表单直接提交到root而不是指定的提交页面

The way it's supposed to work is that index.html submits the message directly to sendgrid.php for some reason that's not working. I've included source code of both scripts in case anyone sees any problems

Server stats:

cPanel Version: 11.48.3 (build 0)
Apache Version: 2.2.27
PHP Version: 5.4.32
Operating System: linux

index.html:

<html>
<head>
<title>Reminderbot</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js" async></script>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/themes/smoothness/jquery-ui.css"/>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js" async></script>
<script src="//cdn.jsdelivr.net/fittext/1.2/jquery.fittext.js" async></script>
<link href='http://fonts.googleapis.com/css?family=Dosis' rel='stylesheet' type='text/css'>
  <script>
  $(function() {
    $( "input[type=submit], a, button" )
      .button();
  });
  </script>
<style>
body {background:#474747;}
h1 {font-family: 'Dosis', Arial, sans-serif;font-size:72pt;text-align:center;color: white;text-shadow: #000 2px 2px 2px;}
#cke_message {box-shadow: #fff 0 0 30px;margin-bottom:2%;}
</style>
</head>
<body>
<h1>Reminderbot</h1>
<form action="sendgrid.php" method="post"><textarea cols="50" rows="15" name="message" id="message"></textarea><center><input type="submit" value="Send" /></center></form>
<script src="//cdn.ckeditor.com/4.4.7/full/ckeditor.js"></script>
<script>
CKEDITOR.replace( 'message' );
</script>
</body>
</html>

sendgrid.php:

<html>
<head>
<title>SEND REPORT</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="//cdn.jsdelivr.net/fittext/1.2/jquery.fittext.js"></script>
<link href='http://fonts.googleapis.com/css?family=Dosis' rel='stylesheet' type='text/css'>
<style>
h1 {
font-family: 'Dosis', Arial, sans-serif;
font-size:144pt;
}
</style>
</head>
<body align="center">
<?php
    error_reporting(E_ALL);
    ini_set("display_errors", 1);
    date_default_timezone_set('EST');
    # Include the API
    require 'vendor/autoload.php';
    require 'lib/SendGrid.php';
    require 'lib/SendGrid/Email.php';
    require 'lib/Smtpapi.php';
    require 'lib/Smtpapi/Header.php';
    require 'html2text.php';
    # Instantiate the client.
    $sendgrid = new SendGrid('...', '...', array("turn_off_ssl_verification" => true));
    $html = $_POST["message"];
    $text = convert_html_to_text($html);
    $date = date('l, F jS ');
    # Make the call to the client.
    $email = new SendGrid\Email();
    $email
        ->addTo('...')
        ->addTo('...')
        ->setFrom('reminderbot@exanple.com')
        ->setFromName('Reminderbot')
        ->setSubject('New reminder for ' . $date)
        ->setText($text)
        ->setHtml($html)
        ->addFilter("templates", "enabled", 1)
        ->addFilter("templates", "template_id", "...");
    $sendgrid->send($email);
    print '<h1>Sent successfully</h1>';
    ?>
</body>
<script type="text/javascript">
    $(document).ready(function() {
        $("h1").lettering();
    });
    </script>
</html>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 sub地址DHCP问题
    • ¥15 delta降尺度计算的一些细节,有偿
    • ¥15 Arduino红外遥控代码有问题
    • ¥15 数值计算离散正交多项式
    • ¥30 数值计算均差系数编程
    • ¥15 redis-full-check比较 两个集群的数据出错
    • ¥15 Matlab编程问题
    • ¥15 训练的多模态特征融合模型准确度很低怎么办
    • ¥15 kylin启动报错log4j类冲突
    • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大