Forum Moderators: coopster

Message Too Old, No Replies

a simple php script can someone help? thanks

         

aliens112

8:21 pm on Mar 26, 2009 (gmt 0)

10+ Year Member



hello I need two scripts but I'm really new to php programing so I though maybe someone can help me with them. I think they are pretty simple so it won't be so hard for the pro's here.

the first one should show an image/url say to 60% of the visitors and the other 40% of the visitors should see another image/url. Or say 6/10 of the visitors see one image and the other 4/10 see another url/img (just giving example)

the second thing I want is after a guy see's a page, he shouldn't be able to see it again. So I collect his ip somewhere in some way and then either by .htaccess or php block him for that certain page.

actually I have something like the first script but I wanna be able to call it trough .htaccess but i'm not sure how. here's with what I came up with, it doesn't do it on a certain percantage (the rand function) but at least it shows the links/images in random sequence.
<?
$random_number = rand(1,4);
if($random_number == 1){
echo "url";
} ?>
do u know how i can tweak this? thank's for your help :)

eeek

10:16 pm on Mar 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



the second thing I want is after a guy see's a page, he shouldn't be able to see it again. So I collect his ip

Give him a cookie instead. An IP address all too often doesn't identify the user.