Click here to Skip to main content
15,886,026 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: creating a table Pin
L Viljoen2-Apr-07 0:32
professionalL Viljoen2-Apr-07 0:32 
Questionpop up windows in .asp pages Pin
starri001-Apr-07 1:06
starri001-Apr-07 1:06 
AnswerRe: pop up windows in .asp pages Pin
Hesham Amin1-Apr-07 6:43
Hesham Amin1-Apr-07 6:43 
QuestionKeeping the values of radio button during paging [modified] Pin
enggars31-Mar-07 7:45
enggars31-Mar-07 7:45 
AnswerRe: Keeping the values of radio button during paging Pin
eggsovereasy2-Apr-07 7:47
eggsovereasy2-Apr-07 7:47 
QuestionHow to force a page to post back from another page? Pin
r_jaz31-Mar-07 2:48
r_jaz31-Mar-07 2:48 
AnswerRe: How to force a page to post back from another page? Pin
Guffa31-Mar-07 4:37
Guffa31-Mar-07 4:37 
Questionphp page being loaded twice Pin
john3431-Mar-07 2:19
john3431-Mar-07 2:19 
Hi all Smile | :)

I have a login php page that is working correctly apart from it wont redirect to another page on successful login.

This is the code I am using:

-----------------

if($rec=mysql_fetch_array(mysql_query("SELECT * FROM user WHERE UserName='$userid' AND Password = '$password'")))
{
if ( headers_sent( $file, $num ) )
{
print "headers were sent in file: $file on line: $line";
}
else
{
header( "Location: http://www.example.com" );
exit;
}
}

--------------

But it seems that the page is loading twice. It is being caught in the if and states that headers have been loaded. However it says that the location is the header() in the else.

Hope that makes sense !! Basically I think it is loading the page the firs time and going into the if statement. Then rather than redirecting to that page it loads itself again and this time gets caught in the else.

WHY is it reloading ????? Any help would be fab Smile | :)

Big Thanks
John

AnswerRe: php page being loaded twice Pin
Bradml31-Mar-07 2:35
Bradml31-Mar-07 2:35 
AnswerRe: php page being loaded twice Pin
Bradml31-Mar-07 4:18
Bradml31-Mar-07 4:18 
GeneralRe: php page being loaded twice Pin
john3431-Mar-07 8:13
john3431-Mar-07 8:13 
GeneralRe: php page being loaded twice Pin
Bradml31-Mar-07 18:31
Bradml31-Mar-07 18:31 
GeneralRe: php page being loaded twice Pin
john341-Apr-07 3:44
john341-Apr-07 3:44 
GeneralRe: php page being loaded twice Pin
Bradml1-Apr-07 3:56
Bradml1-Apr-07 3:56 
Questionbinary data asp Pin
Nilesh Hapse30-Mar-07 23:53
Nilesh Hapse30-Mar-07 23:53 
AnswerRe: binary data asp Pin
Dmitry Khudorozhkov31-Mar-07 2:51
Dmitry Khudorozhkov31-Mar-07 2:51 
Questionvoice chat Pin
tempsh30-Mar-07 23:40
tempsh30-Mar-07 23:40 
AnswerRe: voice chat Pin
Dmitry Khudorozhkov31-Mar-07 2:45
Dmitry Khudorozhkov31-Mar-07 2:45 
QuestionHow to fix, "next, previous," to bottom of browser Pin
starri0030-Mar-07 21:40
starri0030-Mar-07 21:40 
QuestionMasterpage-Contentpage Data Sharing Pin
RickyD230-Mar-07 10:26
RickyD230-Mar-07 10:26 
AnswerRe: Masterpage-Contentpage Data Sharing Pin
Bradml30-Mar-07 13:15
Bradml30-Mar-07 13:15 
GeneralRe: Masterpage-Contentpage Data Sharing Pin
RickyD22-Apr-07 2:30
RickyD22-Apr-07 2:30 
AnswerRe: Masterpage-Contentpage Data Sharing Pin
DavidNohejl1-Apr-07 21:54
DavidNohejl1-Apr-07 21:54 
GeneralRe: Masterpage-Contentpage Data Sharing Pin
RickyD22-Apr-07 2:37
RickyD22-Apr-07 2:37 
QuestionJavascript obfuscator. Pin
sergeyv200230-Mar-07 8:28
sergeyv200230-Mar-07 8:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.