Yes you can, and using else as you proposed.
Depending on your current code(?) you could either:
Use $_SERVER['HTTP_REFERER'] (sic.) to discover which page requested
this page. This method is not ideal, and the referrer-url needs to be parsed - that is, split up to extract the host and page details;
More simply, include a hidden form-field that contains the value of either 'contact' or 'register', or append one of these words as part of a querystring. This can be read by the success page:
PHP Code:
if ($_GET['referee'] && !empty($_GET['referee'])) {
$referee = $_GET['referee'];
if ($referee == 'contact') {
echo "Well done!";
} else if ($referee == 'register') {
echo "Yo there!";
}
}
However, I would suggest that you continue to keep them as separate pages as you are likely to need to do different things according to whether the page is in response to a contact or registration, and to perhaps process data in different ways, or provide quite different page-content. Even if you are not doing this now, you are likely to do so at some point. Besides, it's not difficult to maintain two separate success pages. Not a big deal, but I thought it worth mentioning. YPYM