Count Spots
This is the same as what we used on RMB birthday as a competition. Your guests will go around your site looking for these.
So lets begin,
1) Save the image above or create you own one.
2) Save the following as dot_search.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
//List of all the pages you want the dot to display.
//The to numbers are the X and Y position on the screen.
//Then the value is the page you want them to show on.
//Remember to include a "/" before the page.
$listedURL["800;100"] = "/index.php";
$listedURL["300;450"] = "/aboutus.php";
$listedURL["920;180"] = "/contactus.php";
//End list
//Get the current page the person is on
$current = $_SERVER['REQUEST_URI'];
//Go through all the pages above checking if they are on the same page set by "$current"
foreach($listedURL as $locations => $urls){
//If there is a match
if($current == $urls){
//Get the X and Y location
$location = explode(";", $locations);
//Shows the spot in a div at the set position
echo '<div style="position:absolute; width:40px; height:40px; left:' . $location[0] . 'px; top:' . $location[1] . 'px; background-image:url(\'http://rmb-scripting.com/1.png\');"></div>';
}
}
?>
You need to change the "$listedURL" variables to suit your website.
You can have as many pages listed on the.
Hope you like the tutorial.