|
|
|
|
![]() ![]() |
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 |
|
|
|
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: [MODERATOR] Posts: 3,882 Joined: 24-July 05 From: In Trouble Again... still? Member No.: 9,787 ![]() |
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. 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.
$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. |
|
|
|
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 |
|
|
|
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: [MODERATOR] Posts: 3,882 Joined: 24-July 05 From: In Trouble Again... still? Member No.: 9,787 ![]() |
Topic is resolved.
Please PM any moderator to continue this discussion. Until then, this topic is closed. |
|
|
|
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 |
|
|
|
![]() ![]() |
Similar Topics
| Topics | Topics | |
|---|---|---|
|
|
|
|
Lo-Fi Version | Time is now: 27th July 2008 - 01:26 AM |