; <<>> DiG 9.8.3-P1 <<>> +trace my.oschina.net ;; global options: +cmd . 191557 IN NS e.root-servers.net. . 191557 IN NS i.root-servers.net. . 191557 IN NS a.root-servers.net. . 191557 IN NS k.root-servers.net. . 191557 IN NS g.root-servers.net. . 191557 IN NS j.root-servers.net. . 191557 IN NS h.root-servers.net. . 191557 IN NS c.root-servers.net. . 191557 IN NS l.root-servers.net. . 191557 IN NS f.root-servers.net. . 191557 IN NS d.root-servers.net. . 191557 IN NS b.root-servers.net. . 191557 IN NS m.root-servers.net. ;; Received 228 bytes from 114.114.114.114#53(114.114.114.114) in 39 ms
net. 172800 IN NS m.gtld-servers.net. net. 172800 IN NS l.gtld-servers.net. net. 172800 IN NS k.gtld-servers.net. net. 172800 IN NS j.gtld-servers.net. net. 172800 IN NS i.gtld-servers.net. net. 172800 IN NS h.gtld-servers.net. net. 172800 IN NS g.gtld-servers.net. net. 172800 IN NS f.gtld-servers.net. net. 172800 IN NS e.gtld-servers.net. net. 172800 IN NS d.gtld-servers.net. net. 172800 IN NS c.gtld-servers.net. net. 172800 IN NS b.gtld-servers.net. net. 172800 IN NS a.gtld-servers.net. ;; Received 489 bytes from 198.41.0.4#53(198.41.0.4) in 136 ms
oschina.net. 172800 IN NS ns1.dnsv2.com. oschina.net. 172800 IN NS ns2.dnsv2.com. ;; Received 205 bytes from 192.52.178.30#53(192.52.178.30) in 558 ms
my.oschina.net. 86400 IN CNAME www.oschina.net. oschina.net. 7200 IN NS ns1.dnsv2.com. oschina.net. 7200 IN NS ns2.dnsv2.com. ;; Received 115 bytes from 183.60.59.230#53(183.60.59.230) in 15 ms
<?php // define variables and set to empty values $nameErr = $emailErr = $genderErr = $websiteErr = ""; $name = $email = $gender = $comment = $website = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["name"])) {$nameErr = "Name is required";} else { $name = test_input($_POST["name"]); // check if name only contains letters and whitespace if (!preg_match("/^[a-zA-Z ]*$/",$name)) { $nameErr = "Only letters and white space allowed"; } } if (empty($_POST["email"])) {$emailErr = "Email is required";} else { $email = test_input($_POST["email"]); // check if e-mail address syntax is valid if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/",$email)) { $emailErr = "Invalid email format"; } } if (empty($_POST["website"])) {$website = "";} else { $website = test_input($_POST["website"]); // check if URL address syntax is valid (this regular expression also allows dashes in the URL) if (!preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i",$website)) { $websiteErr = "Invalid URL"; } }
if (empty($_POST["comment"])) {$comment = "";} else {$comment = test_input($_POST["comment"]);}
if (empty($_POST["gender"])) {$genderErr = "Gender is required";} else {$gender = test_input($_POST["gender"]);} }
if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["name"])) {$nameErr = "Name is required";} else { $name = test_input($_POST["name"]); // check if name only contains letters and whitespace if (!preg_match("/^[a-zA-Z ]*$/",$name)) { $nameErr = "Only letters and white space allowed"; } }
if (empty($_POST["email"])) {$emailErr = "Email is required";} else { $email = test_input($_POST["email"]); // check if e-mail address syntax is valid if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/",$email)) { $emailErr = "Invalid email format"; } }
if (empty($_POST["website"])) {$website = "";} else { $website = test_input($_POST["website"]); // check if URL address syntax is valid (this regular expression also allows dashes in the URL) if (!preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i",$website)) { $websiteErr = "Invalid URL"; } }
if (empty($_POST["comment"])) {$comment = "";} else {$comment = test_input($_POST["comment"]);}
if (empty($_POST["gender"])) {$genderErr = "Gender is required";} else {$gender = test_input($_POST["gender"]);} } ?>