Created
October 19, 2016 17:05
-
-
Save dwatrous/382adf705ea65d6380ab7eec936a250a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$services = json_decode(getenv("VCAP_SERVICES"), true); | |
$host = $services['user-provided'][0]['credentials']['alsechohost']; | |
echo "Host from environment: $host"; | |
if (isset($_GET['whatisaid'])) { | |
$ch = curl_init("http://$host/echo.php?message=".$_GET['whatisaid']); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
$response = curl_exec($ch); | |
curl_close($ch); | |
} | |
?> | |
<html> | |
<head> | |
<title>Speak and Echo</title> | |
</head> | |
<body> | |
<form> | |
What you want to say: <input type="text" name="whatisaid"> | |
<input type="submit" value="Say it"> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment