Welcome Guest ( Log In | Register)



 
Closed TopicStart new topic
> Http_redirect() [resolved]
awesomebill61
post Feb 10 2008, 08:57 PM
Post #1


Newbie [Level 3]
***

Group: [HOSTED]
Posts: 48
Joined: 21-January 08
Member No.: 56,591



i am writing a script, and whenever i use this line
CODE
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
Go to the top of the page
 
+Quote Post
jlhaslip
post Feb 10 2008, 09:36 PM
Post #2


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 3,882
Joined: 24-July 05
From: In Trouble Again... still?
Member No.: 9,787
Spam Patrol



php.net reference page here: http://ca3.php.net/manual/en/function.http-redirect.php

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.

CODE
// 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.
Go to the top of the page
 
+Quote Post
awesomebill61
post Feb 11 2008, 03:04 AM
Post #3


Newbie [Level 3]
***

Group: [HOSTED]
Posts: 48
Joined: 21-January 08
Member No.: 56,591



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 wink.gif
Go to the top of the page
 
+Quote Post
jlhaslip
post Feb 11 2008, 04:33 AM
Post #4


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 3,882
Joined: 24-July 05
From: In Trouble Again... still?
Member No.: 9,787
Spam Patrol



Topic is resolved.

Please PM any moderator to continue this discussion. Until then, this topic is closed.
Go to the top of the page
 
+Quote Post
iGuest
post Feb 29 2008, 12:46 PM
Post #5


Trap Double Mocha Member
***************

Group: Members
Posts: 2,360
Joined: 21-September 07
Member No.: 50,369



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:\AppServ\www\aacs\files\headl.Inc:23) in C:\AppServ\www\aacs\klub.Php on line 537

-reply by Asterixs
Go to the top of the page
 
+Quote Post

Closed TopicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Problem With Page Redirect(7)
  2. Http Authentication(2)
  3. Http Authentication Without Using The Popup(3)
  4. Problem With $http_post_vars(3)
  5. Header Redirect Errors(5)


 



- Lo-Fi Version Time is now: 27th July 2008 - 01:26 AM