gpt4 book ai didi

php - 无法对 PHP 脚本使用 get 方法

转载 作者:行者123 更新时间:2023-11-28 02:46:55 24 4
gpt4 key购买 nike

我需要将两个表单输入放入 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"])'
)
);

我删除了我的访问 token 和我的 sid。

最佳答案

向服务器提交数据时为什么不使用POST(in form tag)方式呢?一般使用GET方式从服务器获取数据,POST方式向服务器提交数据。

关于php - 无法对 PHP 脚本使用 get 方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41127410/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com