This can be with any of the following codes .js , .php or .html if you can help it try and avoid databases! + Rep for the first person that posts a script. Thanks!
Your question isn't clear enough. Are you looking for a script that will load a file to a certain IP one time? Then this is not possible (since you don't know if the user closed the browser or not). But if you are talking about file download per ip, then it is a different story. Also you are not allowed to offer reps for answers. Peace,
Ok people, this is what I'm after. I'm after a script that will only load a script once per browsing session. The reason I want this is because I want to show an advert to unique IP's only as there isn't much point in showing the same advert over and over again this is a layered advert so would come over the page once you enter the website from anywhere on the site, after that you wouldn't see that advert again for the rest of your time browsing the site as long as the user dosn't close there browser. What I ment by Rep is if someone posts me a script and it works I will give you a Rep. Thanks!
I was going to say it could be done with .htaccess, but that was because I though you wanted to restrict access to certain IPs.
lol no alittle bit more complex that that. Does anyone even know if it can be done even if I do have to use a database SQL or whatever to store the IP's for browsing sessions. I think it could be done with cookies but not sure how to put it together E.g. the cookie tells the server not to show a script untill it can't find the cookie again, because each time the browser is closed the cookie is deleted?
Cookies can be set to time dependant rather than session dependant. So you could make a cookie last 100 years if you like. It could be done quite easily with cookies if you know PHP. Just display the ad once and create the cookie saying RepeatVisitor = 'true' then in PHP display the ad only if that cookie isn't set.
Right ok all I need know is some PHP that will show a value if it can't find the IP on that persons computer, anyone know how it would work?
I already told you how it would work and it has nothing to do with IP, just a single cookie. 1. check for the cookie. It doesn't exist so... 2. display the ad + create the cookie. 1. check for the cookie. It does exist so... 2. do nothing.
How would I put that together it would be a .js Javascript file I want to show, I know how to put a simple cookie together and but that's about it.