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!
I want users to be directed to a certain form after they pay for services through a third party website, on my site.
How would I block someone from just saving the form.php which would allow a different user to register themselves to
my members area? Remember this is the registration form, the user has not been assigned a user ID or any information. How would I make sure that the person using that form.php came from the third party payment site.
with or with out starting a session?
Can I use sessions to verify the site the user just came from or is there another way?
check the referrer in the $_SERVER superglobal. If it is from the referring site that you want to allow registration from, process the information. Otherwise die() with some witty error message. If you need help with that message the people on these boards just may be able to help you. I would do something like display goatse or whatever but that may be just too mean for some people.
As for the PHP stuff, check out what you get when you do this:
shiznatix wrote:check the referrer in the $_SERVER superglobal. If it is from the referring site that you want to allow registration from, process the information. Otherwise die() with some witty error message. If you need help with that message the people on these boards just may be able to help you. I would do something like display goatse or whatever but that may be just too mean for some people.
As for the PHP stuff, check out what you get when you do this:
[color=#4000FF]<?php
function check_previous($foobar= getenv('HTTP_REFERER'))
{
if ($foobar != 'www.2checkout.com/checkout/...')
{
Header('Location: http://www.myhomepage.php');
}
}
?>[/color]
will this work?
This should certify that the user came from my third party credit card validation site, right or wrong? If I place this at the top of the code, this should automatically redirect them to my homepage, right?