you have page1.php, page2.php and page3.php.
page1.php has a submit button that direct you to page3.php,
page2.php has a submit button that direct you to page3.php.
How do programmers usually check if you came to page3.php from page1.php, page2.php, anyotherpage at this site or any other site...