Skip to main content

Proud to be part of LJMU,
in partnership with the Dill Faulkes Educational Trust

 

Once you've completed the Counting Stars activity why not share your results with us to help us track the amount of light pollution around the UK?

Light Pollution near Wickham, Essex
Credit: Need-Less
Enter the number of stars you observed in total (over the five different positions): "; print "\n"; print "

\n"; print "\n"; // === Children's Uni logo print "
The Children's University
\n"; // === Got a valid totcount, so display the results (keeping the count as a"hidden" parameter in case it is needed again) } else { print "

You observed a total of ".$totcount." stars over the five different positions.

\n"; print "

So the average number of stars you saw each time was ".($totcount/5)."

\n"; // Note this is safe as it will always be a max of 1dp since diving by 5 print "

Therefore you calculated that there are ".round($totcount*193/5)." stars visible across the night sky where you are, so over the entire night sky (northern and southern hemisphere) there are ".round($totcount*193*2/5)." stars visible to the human eye!

\n"; print "\n"; // === If there not a valid postcode, ask for one if($pcode == "") { print "

Other people will probably get a different answer from you. This is because it's more difficult to see the stars if you live in built up areas with lots of lights around, like shops and streetlamps.

\n"; print "

We are making a map of light pollution around the UK using everyones results.
Why not enter your postcode and we can add your results to our map? "; print "\n"; print "

\n"; print "\n"; // ==== Otherwise, add it to the database and say thank you. } else { $conn = mysqli_connect("localhost", "web", "noosawk5"); if(!$conn) { die("Connection to database failed: " . mysqli_connect_error()); } $sql = "INSERT INTO nsoextras.countstars VALUES(NULL,"; // == If possible, get the user ID and username global $user; if(!user_is_anonymous()) { $sql = $sql."'".$user->uid."','".mysqli_real_escape_string($conn, $user->name)."',"; } else { $sql = $sql."NULL,NULL,"; } // == add totcounts and pcode $sql = $sql."'".mysqli_real_escape_string($conn, $totcount)."','".mysqli_real_escape_string($conn, $pcode)."',"; // == add added and lastmod $sql = $sql . "NOW(),NOW());"; mysqli_query($conn, $sql); print "

Thank you. We will use your results to update our map.

"; } // === Children's Uni logo and "code" print "
The Children's University\n"; print "
Your Children's University code for this activity is yellow9679
\n"; } ?>