【发布时间】:2016-12-13 17:44:16
【问题描述】:
我需要将两个表单输入放入一个 php 脚本中。我使用 get 方法,但是当我尝试在我的网络服务器上运行代码时,出现 500 错误。
index.html
<!DOCTYPE html>
<html>
<head>
<title>SMS</title>
</head>
<body>
<form action="send_besked.php" method="get">
Tlf:: <input type="text" name="number"><br>
Besked: <input type="text" name="msg"><br>
<input type="submit">
</form>
</body>
</html>
这里是 send_besked.php
<?php
// Required if your environment does not handle autoloading
require __DIR__ . '/vendor/autoload.php';
// Use the REST API Client to make requests to the Twilio REST API
use Twilio\Rest\Client;
// Your Account SID and Auth Token from twilio.com/console
$sid = 'xxxxx';
$token = 'xxxxx';
$client = new Client($sid, $token);
// Use the client to do fun stuff like send text messages!
$client->messages->create(
// the number you'd like to send the message to
'($_GET["number"])',
array(
// A Twilio phone number you purchased at twilio.com/console
'from' => '+19152282067',
// the body of the text message you'd like to send
'body' => 'echo ($_GET["msg"])'
)
);
我已经删除了我的访问令牌和我的 sid。
【问题讨论】:
-
您有权访问您的服务器日志吗? 500 个错误会在日志中写入一些内容,让您了解发生了什么。