LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-23-2008, 06:32 PM   #1
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
mod_python: how do you do the equivalent of php's header("Location: XX")?


I'm trying to strip POST from an html query. In php, I'd handle POST then do something like:

PHP Code:
header("Location: ".$_SERVER['PHP_SELF']); 
... this way if someone hits "reload" after posting a form, they wouldn't get the "Are you sure you want to resend POST data?"

I could have sworn there was a similar concept in mod_python, but I can't find it.

Anyone know?
 
Old 06-23-2008, 09:28 PM   #2
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Original Poster
Rep: Reputation: 51
I think I've posted this very answer to myself before. It's official, I'm loosing my mind.

Anyway, here's the answer in case anyone else runs across this:
Code:
  from mod_python import util

  util.redirect(req, req.uri)
req.uri could be any string, including "http://google.com" or something similar.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there an "apt-get" equivalent of "yum list available"? geeeeky.girl Linux - General 3 07-20-2008 08:40 PM
How to supply extra commands along with PHP header("Location: http://www.abc.com")? alphaque Programming 3 05-26-2006 04:28 AM
PHP header("Location: xxx.php") not working? baddah Programming 7 05-10-2006 09:00 AM
Location of the directory of "C" header files RoMan65 Linux - Software 8 01-19-2006 04:59 PM
PHP header("Location") Gerardoj Programming 1 05-11-2004 04:29 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration