Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
|
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 13th, 2004, 01:31 PM
Registered User
 
Join Date: Aug 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Header rediect problem ....

Hello:

To do a automatic redirect I use the following from one page:
header("Location: nowdothis.php");

(All my pages are in the same folder).

I am using IIS and have set up a virtual directory for my app.

I get the following error:

The page cannot be displayed
  The page you are looking for cannot be displayed because the
  page address is incorrect.

Any help appreciated.

Thanks



 
Old October 13th, 2004, 02:13 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

What is the address that shows up in the addressbar?

Try using an absolute address:

header("Location: http://localhost/your_virtual_directory/nowdothis.php");

Let me know,

-Snib <><
Try new FreshView 0.2!
There are only two stupid questions: the one you don't ask, and the one you ask more than once ;)
 
Old October 13th, 2004, 02:52 PM
Registered User
 
Join Date: Aug 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

the addressbar shows http://localhost/virtual folder/

After putting absolute address in my code i get the same error.

 
Old October 14th, 2004, 09:13 AM
Registered User
 
Join Date: Aug 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello:

I found my problem. Turns out it is not with the header function.
I was using this code to self refence my page:
  <FORM METHOD=POST ACTION=<? $PHP_SELF ?>

I changed it to specify my page explicitly as follows and now everythings works wonders...
  <FORM METHOD=POST ACTION="login.php">

Thanks for the help.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with matrix header (bug?) roy_mm Reporting Services 0 November 5th, 2006 02:54 AM
Header Function Problem. changusee2k PHP How-To 1 September 27th, 2006 02:45 AM
header problem? hosefo81 PHP How-To 4 June 23rd, 2006 01:06 AM
header redirection problem ronin2307 Pro PHP 2 September 1st, 2004 07:58 PM
Header redirection problem ronin2307 Beginning PHP 1 September 1st, 2004 04:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.