I want to send a post request with a url redirect to a request page. Jest think request page currently use for handle submit form.
I tried the following code to my request page.
<?php
$myFile = "test.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "Request come to the page
";
fwrite($fh, $stringData);
if (isset($_POST)) {
$stringData = $_POST['user'];
fwrite($fh, $stringData);
}
fclose($fh);
echo 'page found';
I tried Zend_Http_Client
to do that. This is my simple action.
public function indexAction()
{
$client = new Zend_Http_Client('http://localhost/test/test.php');
$client->setParameterPost(array('user' => 'dinuka'));
$client->setConfig(array('strictredirects' => true));
$response = $client->request(Zend_Http_Client::POST);
}
Now request send to the test.php. But not redirect to the http://localhost/test/test.php
page. I want send request + redirect. I asked this question previously. But it closed as pure question. Please help me. I haven't good knowledge about http request. What is the strictredirects
?