?
Solved

Checking if a domain exists or not ?

Posted on 2003-02-23
7
Medium Priority
?
212 Views
Last Modified: 2010-04-09
If I create a form thats asks for a domain to be entered, i.e. MSN.COM how can I pass this to a whois database and get a value back if it exists, then how do I read this value so I can goto a different weburl depending on the results ?
0
Comment
Question by:MirageSF
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 6

Expert Comment

by:mattjp88
ID: 8005424
i think that the only way would be to check and see if there is an "http://" and a ".com" or ".org" ect.  if you think that thins will work then i will write a script for ya

Matt :-)
0
 
LVL 1

Expert Comment

by:Jonza
ID: 8006417
Is it possible to use PHP?
I would have a great function for you that checks if the given URL exists.
0
 
LVL 1

Expert Comment

by:Jonza
ID: 8006422
function urlExists($url)
{
$url = ereg_replace("http://", "", $url);
list($domain, $file) = explode("/", $url, 2);
$fid=fsockopen($domain,80);
fputs($fid,"GET /$file HTTP/1.0\r\nHost: $domain\r\n\r\n");
$gets = fgets($fid, 1024);
fclose($fid);
if (ereg("HTTP/1.1 200 OK", $gets)) return TRUE;
else return FALSE;
}

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:MirageSF
ID: 8006821
That looks cool, but how do I call that from a html page ?  sorry for being a total noob :)
0
 
LVL 1

Accepted Solution

by:
Jonza earned 400 total points
ID: 8006861
here is a code for you:
-------------- form.php --------------------
<?php
function urlExists($url)
{
$url = ereg_replace("http://", "", $url);
list($domain, $file) = explode("/", $url, 2);
$fid=fsockopen($domain,80);
fputs($fid,"GET /$file HTTP/1.0\r\nHost: $domain\r\n\r\n");
$gets = fgets($fid, 1024);
fclose($fid);
if (ereg("HTTP/1.1 200 OK", $gets)) return TRUE;
else return FALSE;
}


if(isset($url) && !empty($url)){
   $check = urlExists($url);
   if($check){
      print("YEAH, the URL exists: <a href='$url'>$url</a>");
   }
   else{
      print("No, the url doesn't exist!");
   }
}//if
?>
<form action='form.php' method='post'>
<input type='text' name='url' value='http://experts-exchange.com'>
<br><input type='submit' value='check url'>
</form>
-------------- end of form.php -----------------

works 100% fine =)
0
 
LVL 2

Expert Comment

by:rbagdonas
ID: 8019338
If using ASP:

I have a small COM+ object that checks for domain name availablity and presents you with a true/false whether it is available.  That way you do not have to send them to a different page can do this behind the scenes in your ASP code.

If you want more info, email me at info@siliconhillsgroup.com

R
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 8820403
This question has been classified abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

<note>
Unless it is clear to me that the question has been answered I will recommend delete.  It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.
</note>

If the user does not know how to close the question, the options are here:
http://www.experts-exchange.com/help/closing.jsp


Cd&

0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question