Website Validation for a specific text field

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Website Validation for a specific text field
asgsoft
CZ Super Newbie
asgsoft has been a member for over 19 year's 19 Year Member
egypt.gif
Gender: Male
Status: Offline
Joined: Dec 12, 2004
0.00 posts per day
Posts: 30
Points: 1,122
   
Is there a way to valiadate wheather a person has entered a valid website by checking it has more than one "." or something.or soem other way thank you very much



Back to top Reply with quote
#2   re: Website Validation for a specific text field
Taut
PayPal Donation
CZ Revered Member
 Codezwiz Site Donator
Taut has been a member for over 20 year's 20 Year Member
usa.gif california.gif
Occupation: Entrepreneur
Gender: Female
Fav. Sports Team: SF Giants
Status: Offline
Joined: May 27, 2003
0.72 posts per day
Posts: 5530
Points: 481,695
   
depending on the type of site you have, google produces quite a few scripts for either a php site or an html site.



Back to top Reply with quote
#3   
Telli
Site Admin
Telli has been a member for over 20 year's 20 Year Member
Occupation: Self Employed
Age: 45
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.06 posts per day
Posts: 8089
Points: 494,430
   
Here is one I wrote to validate links written in php your more then welcome to use it.:


if (url_validate("http://www.codezwiz.com")) {
      echo "OK";
} else {
      echo "Problem with URL";
}
 
function url_validate($link) {       
       $url_parts = @parse_url($link);
       if (empty($url_parts['host']))  { return false; }
       if (!empty($url_parts['path'])) {
           $documentpath = $url_parts['path'];
       } else {
           $documentpath = "/";
       }
       if (!empty($url_parts['query'])) {
           $documentpath .= "?" . $url_parts['query'];
       }
       $host = $url_parts['host'];
       $port = $url_parts['port'];
       if (empty($port)) { $port = "80"; }
       $socket = @fsockopen($host, $port, $errno, $errstr, 30);
       if (!$socket) {
           return false;
       } else {
           fwrite ($socket, "HEAD ".$documentpath." HTTP/1.0\r\nHost: $host\r\n\r\n");
           $http_response = fgets($socket, 22);
           if (ereg('200 OK', $http_response, $regs)) {
               return true;
               fclose($socket);
           } else {
               return false;
           }
       }
}




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#4   re: Website Validation for a specific text field
asgsoft
CZ Super Newbie
asgsoft has been a member for over 19 year's 19 Year Member
egypt.gif
Gender: Male
Status: Offline
Joined: Dec 12, 2004
0.00 posts per day
Posts: 30
Points: 1,122
   
it is part of a form i want it to check that the user has entered a valid domain rather than just any old writing



Back to top Reply with quote
#5   
Telli
Site Admin
Telli has been a member for over 20 year's 20 Year Member
Occupation: Self Employed
Age: 45
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.06 posts per day
Posts: 8089
Points: 494,430
   
Thats what you would use. In the feedback form you add that funtion then use it to check the email they enter.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#6   
asgsoft
CZ Super Newbie
asgsoft has been a member for over 19 year's 19 Year Member
egypt.gif
Gender: Male
Status: Offline
Joined: Dec 12, 2004
0.00 posts per day
Posts: 30
Points: 1,122
   
not email,i am asking them to enter their domain. not as part of the email address



Back to top Reply with quote
#7   
Telli
Site Admin
Telli has been a member for over 20 year's 20 Year Member
Occupation: Self Employed
Age: 45
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.06 posts per day
Posts: 8089
Points: 494,430
   
Sorry I meant website. Thats what that function does it checks the URL to make sure it is valid.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#8   
asgsoft
CZ Super Newbie
asgsoft has been a member for over 19 year's 19 Year Member
egypt.gif
Gender: Male
Status: Offline
Joined: Dec 12, 2004
0.00 posts per day
Posts: 30
Points: 1,122
   
but that only checks one domain! i want it to validate any domain



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum