How to handel postback event in php

Hi
Can anybody tell me how can i handel postback event in php like in asp.net
I want to execute soem code only when page load now when the page is
posted back from server(when button click)?

Thanks.

if (!isset($_POST)) {
    //code here
}

Unless your code requires something different.

That would be:


if ($_SERVER['REQUEST_METHOD'] == 'POST') {
  // handle POST here
}

Thanks to both of u for u r rply…
yes i have done it.

Hi, I am having my own problems with redirects:

OK let me try to make myself clear here.

I have two parts to a website a general side and another part to the site called photography.

Both parts to the site share the same navigation.

For one of the links in the side navigation i have a link called FAQ’s.

Rather then have 2 different faq links shown I want to create a conditional that if your on the general side of the site go to the general faq and if your on the photography side go to the photo faq.

so something like this i think:

if (gen1.php, gen2.php, gen3.php)
{ go to this gen-faq.php page }

else if (photo1.php, photo2.php)
{go to this photo-faq.php page}

Im not sure if this is the way I would even go around doing this. BUT COULD SOME ONE PLEASE HELP ME WITH THIS PROBLEM

thanks