@Burti;
Buyur;
<?php
if($_POST) {
header("Content-Type: text/plain; charset=UTF-8");
$URL = "http://httpbin.org/post"; #@pass
$post_fields = "";
$post_field_keys = array_keys($_POST);
$post_field_values = array_values($_POST);
foreach($post_field_keys as $key => $value)
$post_fields .= sprintf("%s=%s&", $post_field_keys[$key], $post_field_values[$key]);
$post_fields = rtrim($post_fields, "&");
unset($post_field_keys, $post_field_values, $key, $value);
$handle = curl_init();
curl_setopt($handle, CURLOPT_URL, $URL);
curl_setopt($handle, CURLOPT_POST, true);
curl_setopt($handle, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
$response = (object) array(
"body" => curl_exec($handle),
"info" => curl_getinfo($handle),
"error" => (object) array(
"no" => curl_errno($handle),
"message" => curl_error($handle)
)
);
#@optional(s) [begin]
$response->body = json_decode($response->body);
#@optional(s) [end]
print_r($response);
exit; #@pass HTML
}
?><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
</head>
<body>
<form method="post">
<label for="yazi">Yazı:</label>
<input type="text" id="yazi" name="yazi" placeholder="bi' kaç cümle bi' şeyler yaz" />
<button type="submit">Gönder</button>
</form>
</body>
</html>