OTrap
Elite Member
- Jul 12, 2008
- 2,314
- 1,064
I'm presuming to do this with an if/else statement, predominantly because I'm still something of a PHP novice.
What I'm wanting to do is this:
Visitor A comes to my site. His IP address is 111.111.111.111. He fills in an opt-in form. He then attempts to go to the initial page again and submit ANOTHER set of details in the form.
I'd like to be able to show a different page of code if the IP has been tracked before. Something like this:
Am I biting off more than I should be by wanting to do this? If it's too complicated, I wouldn't want anyone to put too much time into explaining it, but if it's a quick or simple process, I'd sure love some help.
What I'm wanting to do is this:
Visitor A comes to my site. His IP address is 111.111.111.111. He fills in an opt-in form. He then attempts to go to the initial page again and submit ANOTHER set of details in the form.
I'd like to be able to show a different page of code if the IP has been tracked before. Something like this:
PHP:
<?php
get visitor's IP address;
check his IP address against a database;
if his IP shows up on the database {
echo "You've been here before.";
} else {
echo "Hey; you are new!";
}
write the visitor's IP address to the database;
?>
Am I biting off more than I should be by wanting to do this? If it's too complicated, I wouldn't want anyone to put too much time into explaining it, but if it's a quick or simple process, I'd sure love some help.