0

I’m sending this url encoded message: http://anydomain.com/message.php?Message=This+is+a+test+message

To this url: http://anydomain.com/message.php

I can’t figure out how to decode and get “This is a test message” in the $response-> say() below. here's the code..

<?php

require_once(‘Services/Twilio.php’);

$response = new Services_Twilio_Twiml();

$response->pause(array("length" => 1));
$response->say(*how do i put the url encoded "This is a test message" message here??*, array("voice" => alice));
$response->pause(array("length" => 1));    
$response->say('End of message', array("voice" => alice));

print $response; 

The rest of the twiml works... new at this so any help would be much appreciated. Thanks- Jim

auth private
  • 1,318
  • 1
  • 9
  • 22
jimk
  • 23
  • 5

1 Answers1

1

You should be able to read it off the $_GET variable, simple do this:

$response->say($_GET['Message'])

Where Message is what you passed in the URL, so $_GET['Message'] will contain “This is a test message”

ecorvo
  • 3,559
  • 4
  • 24
  • 35
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - [From Review](/review/low-quality-posts/10814135) – Alex Andrei Jan 07 '16 at 21:18
  • @AlexAndrei I am just curious... How do you know it is not an answer? – ecorvo Jan 07 '16 at 21:21
  • I would say an answer would be accompanied by some explanation as to why it works, if you are pointing to some mistake in the OP's code, you should make that clear. Your answer is a suggestion at best, it doesn't say **why** the OP should be doing what you ask. – Alex Andrei Jan 07 '16 at 21:28