How to check PostBack condition

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
iijb
Forum Commoner
Posts: 43
Joined: Wed Nov 26, 2008 11:34 pm

How to check PostBack condition

Post by iijb »

Hi all,
I want to check postback condition in my application. Please help me how is this possible.
Thanks
iijb
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: How to check PostBack condition

Post by requinix »

If you don't give much of a question then I can only assume you don't want much of an answer:

Depends what the condition is, but you'll surely need to use some variables, maybe a couple functions, and control blocks like if or switch.
User avatar
iijb
Forum Commoner
Posts: 43
Joined: Wed Nov 26, 2008 11:34 pm

Re: How to check PostBack condition

Post by iijb »

Hi,
I got an error when redirecting to another page. Error is attached below.

Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\sregstn1.php:118) in C:\wamp\www\sregstn1.php on line 238

and the code is:

if(mysql_num_rows($result))
{
if($admno==$admission_no&&$stid==$student_id&&$usrid!="")
{ echo "Already Registered User"; }
else if($admno==$admission_no&&$stid==$student_id&&$usrid=="")
{

header("Location: register.php");

}
}

Why is this error occuring. I am a newbie , I think I have to check postback. Please help me.
iijb
User avatar
iijb
Forum Commoner
Posts: 43
Joined: Wed Nov 26, 2008 11:34 pm

Re: How to check PostBack condition

Post by iijb »

Hi,
I fixed the problem. There is some whitespaces in the code. I remove all the whitespaces and the header error gone.

Thanks all
iijb
Post Reply