2

I have a php script that passes a value to an http://something..../wsgi.py page which computes and returns a value.

I do not want to display this .py page. Instead, I want to call another php page along with the value computed by the python page.

Any pointers on how to proceed?

2 Answers 2

2

An elegant solution to this problem would be to return an HTTP redirect response from the Python script. With such a solution, your browser doesn't need to load and display the HTML from the Python script, making the redirection more transparent to the user.

A code snippet creating HTTP redirect with WSGI follows:

def redirector_app(environ, start_response):
   param = '' # Set the parameter you want to pass here
   start_response('301 Redirect', [('Location', 'http:/yourphpscript.com/?param=%s' % param),])
   # ...
Sign up to request clarification or add additional context in comments.

Comments

1

If a <form> is unacceptable, you can use an HTML <link> or <img> tag in order to make the browser request the indicated URL.

2 Comments

Feel free to accept the answer or add your own if you're not satisfied with this one.
Yes. If you are satisfied with this answer, please mark it as your preferred solution.

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.