Mark: If I echo the statement I get "Resource id #<number>".. no indication of any errors
ctimmer: So are you saying that PHP can see code written *after* the redirect? I tried redirecting and writing all kinds of nasty stuff right after the redirect statement, but nothing would nullify it or even be seen at all by PHP. So while the redirect was working, I could return true, false or echo something and it wouldn't matter</number>
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- internetking created topic »password problem« 25. May
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- ehdwma created topic »Hide "Register new account" and change template to 3 col« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
- mdee created topic »How to implement returnpage ?« 25. May
- nestormateo responded to »Fillters in Clip« 24. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
pnRedirect
-
- Rank: Softmore
- Registered: Feb 07, 2003
- Last visit: Jun 11, 2008
- Posts: 225
The redirect sends a response back to the browser 'redirecting' it to another URL. The PHP code continues, but depending on how the browser handles the redirect, is most likely no longer be connected to the browser. At this point, any output from this instance would only be writing to a broken connection. -
- Rank: Softmore
- Registered: Jul 16, 2004
- Last visit: Oct 21, 2009
- Posts: 406
Is there any way to include the current form data when using pnRedirect?
ie.
list($var1, $var2) = pnVarCleanFromInput('var1','var2');
if (!isset($var2) || empty($var2)) {
pnSessionSetVar('errormsg', pnVarPrepHTMLDisplay("var2 empty"));
return pnRedirect(pnModURL('Example', 'user', 'new','var2'));
} -
- Rank: Developer
- Registered: Jun 03, 2002
- Last visit: Dec 21, 2009
- Posts: 284
Use
Code
--
cyber_wolf
www.bkbsolutions.com - My Zikula module development site. -
**unknown user**
- Rank: Softmore
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 418
Just wondering... But I noticed there aren't any header sent with pnRedirect. Which means there's a 302 Found send. This means SE's will index the old URL, instead of they're gonna index the URL which is redirected too.
Wouldn't it be wiser to send out 301 Moved Permanent headers befor a location?
Why would we want to redirect, but not tell the client the page has moved? -
- Rank: Softmore
- Registered: May 30, 2005
- Last visit: May 31, 2010
- Posts: 340
Hunkpapa,
Quote
I have no idea why but pnRedirect does absolutely nothing for me:
pnRedirect('http://www.postnuke.com');
I had a similar problem a while back and worked out this bit of code for tracking it down.
Code
function Exams_admin_test()
{
if (headers_sent($filename, $linename)) {
echo "headers are already sent in $filename at $linename";
} else {
pnRedirect(pnModURL('Exams', 'admin', 'viewitems'));
return true;
}
}
By including the $filename and $linename in headers sent, it points you to the problem file. In my case it was a bit of white space in an included file. When I removed that space, the problem disappeared. You might want to try this and see if you can find the problem.
edited by: Paustian, Dec 03, 2006 - 03:31 AM
- Moderated by:
- Support
