1

I want to redirect a PHP page and post data to that page without using Header("Location:http://www.example.com").

If anybody knows please help me. I tried some Zend functions also. Please explain anybody clearly.

Thanks

1
  • You could have a form with hidden form elements, that auto-submits onload, BUT if you have to do that, you're doing something wrong. Commented Sep 23, 2011 at 10:56

4 Answers 4

5

You cannot redirect to a POST.

You can redirect to a GET and header() us perfectly fine for that.

Sign up to request clarification or add additional context in comments.

2 Comments

i cannot use get method to redirect. The query string creates some problem and the size is very small comparatively post method
problem? what kind of problem? what do you mean the size is very small?
1

What is the matter of not using header('Location:.... ?

If you describe exactly what is the problem, then is easyer to get an answer.

1 Comment

If i use Header, i can post the data to that page with query string like get method. The size is too small and header makes page very slow.
1

If you are using Zend Framework you can redirect from one controller action to another action as such:

return $this->_forward("action", "controller", "module");

5 Comments

i tried _forward method. But it wont work outside Zend class. If you already with the same example please share the example with us. It will be very useful.
I'm sorry I only have id inside the same classe. Maybe this (framework.zend.com/manual/en/zend.controller.dispatcher.html) could help.
thanks dude. I already know about that method. But i need a exact example of that _forward method.
ehmm.. if you do redirect after a modifying operation you need a proper redirect, otherwise a page reload can cause problems.
ya.. that modifying redirects works fine if i use Header. otherwise it fails. I tried CURL also. I really stuck with that
0

Well you could use AJAX code to post data to another page in the background and then update the current page with the posted data's results. That would do the job, though it very much depends what you want to do after submitting the data to your other page.

1 Comment

if i use AJAX to post data, it needs some responses after posting the data. After posting to that page also i did some redirects on the post data page.

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.