4

I want to redirect users to a external payment gate with some parameters using zend.is there any standard way of doing it ?

really appreciate any advice and suggestions.

thanks.

3 Answers 3

6

You could use the built in PHP function of http_build_query to build the parameters, then feed that to the gotoUrlAndExit() function of Zend Framework.

$url = "https://external.gateway.com/";
$data = array('foo'=>'bar',
              'baz'=>'boom',
              'cow'=>'milk',
              'php'=>'hypertext processor');

$query = http_build_query($data);

$this->_helper->redirector->gotoUrlAndExit($url . '?' . $query);
Sign up to request clarification or add additional context in comments.

2 Comments

thanks guys awesome..special thanks to nvoyageur for example..u r a real time saver..
@sha, if you like my answer, please "accept" it and give it an upvote. This will build your reputation score.
4

In ZF there is Redirector action helper. It has methods called gotoUrl() and gotoUrlAndExit() that can be used to go to external urls. Maybe this helper will be suited for your needs.

Comments

2
$this->_redirect($url);

Just put it in your action

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.