awesomebill61 0 Report post Posted February 10, 2008 i am writing a script, and whenever i use this line http_redirect("process.cgi");i get a call to undefined function error for http_redirect().maybe i am misunderstanding what this function is used for..... when i call it, it will take the user to the page indicated... in my case "process.cgi"that was my interpretation of it from the page in the php manual.i am running xampp for windows and php 5.2.1 Share this post Link to post Share on other sites
jlhaslip 4 Report post Posted February 10, 2008 php.net reference page here: http://forums.xisto.com/no_longer_exists/I believe this function requires the PECL Class installed, but I could be wrong. Do you know if you have that in place?also, do you have any other output PRIOR to this call, since it issues Headers and NOTHING can precede the Header in the page output. Even a blank line sent to the HTML page will cause a problem with Headers being sent.You may require a different function. Here is a sample of a re-direct that I use. It builds the re-derict URL from scratch. // Start defining the URL. $url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']); // Check for a trailing slash. if ((substr($url, -1) == '/') OR (substr($url, -1) == '\\') ) { $url = substr ($url, 0, -1); // Chop off the slash. } $url .= '/index.php'; // Add the page. Change the filename to suit. header("Location: $url"); exit(); // Quit the script.This was written to redirect within an application. If you need to re-direct to another location on the web, I would suggest another method. Share this post Link to post Share on other sites
awesomebill61 0 Report post Posted February 11, 2008 bah. yea it says right at the top of the page it is part of PECL... that would be the problem.thank you for figuring out what my absent-mindedness could not Share this post Link to post Share on other sites
jlhaslip 4 Report post Posted February 11, 2008 Topic is resolved.Please PM any moderator to continue this discussion. Until then, this topic is closed. Share this post Link to post Share on other sites
iGuest 3 Report post Posted February 29, 2008 redirect problem Http_redirect() [resolved] But how to redirect after using include and require? The header says error. Warning: Cannot modify header information - headers already sent by (output started at C:AppServwwwaacsfilesheadl.Inc:23) in C:AppServwwwaacsklub.Php on line 537 -reply by Asterixs Share this post Link to post Share on other sites
iGuest 3 Report post Posted August 7, 2008 Re:http_redirect Http_redirect() [resolved] Replying to iGuest You can use this code: PHPTAGOPEN Ob_start(); PHPTAGCLOSE ///// Your code ,include header(location:...); //// PHPTAGOPEN Ob_end_flush(); PHPTAGCLOSE -reply by azade Share this post Link to post Share on other sites