Hi, I'm trying to figure out how to display an email address for the first visitor of a page and hide the email address from everyone else. The page is created by the first visitor via a form and I want them to see an email address only meant for their eyes only. I've tried using PHP Session variables but that doesn't work, I was thinking cookies would be the best bet but I wanted some opinions. Any help would be great, Thanks!
You can't use session variables nor cookies, as they work at a client level (for all visitors). You need to create a file on your server the first time the script runs, and check if the file exists then. if(!file_exists("showed.txt"){ echo "your@email.com"; file_put_contents("showed.txt","showed"); } Code (markup): This file will exist on your server and once created, the email will no longer be shown.