简体   繁体   English

无法对PHP脚本使用get方法

[英]Can't use the get method for PHP script

I need to place the two form inputs into a php script. 我需要将两个表单输入放入php脚本。 I use the get method, but when i try to run the code on my webserver i get a 500 error. 我使用get方法,但是当我尝试在Web服务器上运行代码时,出现500错误。

index.html 的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> 

Here is the send_besked.php 这是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"])' ) ); 

I had deletede my access token and my sid. 我已经删除了我的访问令牌和sid。

在向服务器提交数据时,为什么不使用POST(表单标签)方法?通常,GET用于从服务器获取数据,而POST用于向服务器提交数据。

I figured it out. 我想到了。

I made it to a post script and deleted the following symbols 我将其发布到脚本中并删除了以下符号

 ' 

Thank you for your help 谢谢您的帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM