2016-12-13 7 views
2

2つのフォーム入力をPHPスクリプトに配置する必要があります。私はgetメソッドを使用しますが、私のウェブサーバ上でコードを実行しようとすると500エラーが発生します。ここでPHPスクリプトのgetメソッドを使用できません

index.htmlを

<!DOCTYPE html> 
 
<html> 
 
<head> 
 
\t <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>

は、私は私のdeletedeアクセストークンと私sであった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"])' 
 
    ) 
 
);

ですid。

+0

ありがとうござい削除? 500のエラーはログに何かを書き込んで、何が起こっているかをあなたに知らせます。 – GentlemanMax

答えて

0

サーバーにデータを送信するときにPOST(フォームタグ)方式を使用しないのはなぜですか?通常、GETはサーバーからデータを取得するために使用され、POSTはサーバーにデータを送信するために使用されます。

0

私はそれを理解しました。

私はポストスクリプトにそれを作ったし、次の記号

'

はあなたのサーバログへのアクセス権を持っていますかあなたの助け

関連する問題