'$backthen' and ip='$ra';"; $result=mysql_query($sql); if($row=mysql_fetch_array($result)){ $rowthen=$row["tid"]; $sec1=(strtotime($rowthen)); $sec2=(strtotime($backthen)); $sec=$sec1-$sec2; header("Location:/pleasewait.php?sec=$sec&returnurl=$_GET[returnurl]"); }else{ include("geoip.inc"); $gi = geoip_open("GeoIP.dat",GEOIP_STANDARD); $ccode=geoip_country_code_by_addr($gi, $ra); $cname=geoip_country_name_by_addr($gi, $ra); geoip_close($gi); $mood=substr($selected,0,1); if(!$ccode){ $ccode="XX"; } $sql="INSERT INTO wmi (id,tid,land,mood,ip) VALUES ('',NOW(),'$ccode', '$mood', '$ra');"; $result=mysql_query($sql); if($_GET[returnurl]){ header("Location:$_GET[returnurl]"); }else{ header("Location:/thankyou.php"); } } }else{ $o="
How are you doing?

Help us track the world's mood. Please click one of the smileys below.

\"\"

I'm feeling positive
\"\"

I'm feeling negative
"; $pt=" - How are you doing?"; include("template.php"); } ?>