Nibble Guru - Computing queries demystified Thursday, January 08, 2009
Home
My Account / Register
Login / Logout
Post your Problem!
Search

About Us
Contact Us



List Home > Programming / Scripting >   [ Post New Problem ]

Welcome back !
TrackingID : 268
Posted : Monday, December 29th, 2003 11:50:34 PM
By : elesha
redirection using PHPConfiguration:
I am trying to create a simple page which asks users for a username and a password. Once they enter the username and password, I pass those values $PHP_SELF and check them against the database....after doing that I want to either reload the page if the values are incorrect or redirect the user to another page if the values are correct. I know how to reload...simply echo the form again! But how do I redirect if the values are correct? Operating System : LINUX redhat

Comments :
Re: redirection using PHP by nibbleguru on December 30th, 2003 11:32:34 AM
Use

header('Location: http://newlocation/');
Re: redirection using PHP by elesha on December 30th, 2003 12:22:10 PM
ok here is the code I wrote...nothing comlicated..
redirection







But I kept getting an error saying that :"Cannot send header information becasue it has already been sent."
I dont know what that means! PLease help!
Re: redirection using PHP by elesha on December 30th, 2003 12:24:14 PM
sorry the code in HTML does not show up in my previous comment...here it is then:
Re: redirection using PHP by nibbleguru on December 31st, 2003 01:09:50 AM
To use
header('Location: http://newlocation/');

you must have this code before you output anything.
no html/empty lines should have had got printed.

something like:-
if($user_ok) {
header('Location: http://newlocation/');
}
else {
//output all your html here
}
Re: redirection using PHP by gregmiller on June 10th, 2004 12:45:56 AM
check if you have any whitespace or exactly before your php declaration
or u havent sent any information before using header
hope this solves ur prob
Greg
Re: redirection using PHP by Anonymous Ghost on November 10th, 2004 01:17:58 AM
we are trying for the same thing
gfhfhgh: by Anonymous Ghost on September 26th, 2006 11:51:34 PM
grghdeher
Post a Note :
UserName (not required in anonymous posts)
Password (not required in anonymous posts)
Post Anonymous (check this only if you wish to post anonymously.)
Subject
Comment (limited HTML allowed)



List Home > Programming / Scripting >   [ Post New Problem ]
Copyright © 2001-2009, Nibble Guru