I am sending same data with PHP cURL. But I am using "\n" character in a text area and it prints "Empty reply from server". Unless I use "\n", it is working.
For example:
<form action="gonder.php" method="post">
<textarea name="content" rows=23 cols=70></textarea>
<input class="button" type="submit" value="Kaydet">
</form>
And my gonder.php file:
<?php
if($_POST['content'] != ""){
$ch = curl_init('http://address/page.php');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'bilgi='.$_POST['content']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch) or die(curl_error($ch));
header("Location: index.php?olay=2");
}
?>
Additional information: My file has single-quotes at the end.
How can I solve this problem?
veriler.txt:
araba
ev
dükkan
mağaza
veriler.txt is in another server and I want to rewrite it with a textarea using post method