GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 20-Dec-2003, 16:50
encoderX encoderX is offline
New Member
 
Join Date: Dec 2003
Posts: 2
encoderX is on a distinguished road
Question

Domain to hostname script req.


Hi
I am trying to do the following and hope you can help.

I want people so they can put a domain in a form and it will result the hostname eg:
input encoderx.co.uk and it will result/show uk6-u.valuehost.co.uk which is the hostname of my domain where my domain is held.

Hope you understand and thank you

encoderX.co.uk
  #2  
Old 20-Dec-2003, 17:10
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Hello encoderX,

Good question... I had to think for a while.

Maybe you can try this and see if it gives you the results that you expect...
PHP Code:

<?php

// the domain
$domain = 'encoderx.co.uk';
$ip = gethostbyname( $domain );
$host = gethostbyaddr( $ip );
echo "\$host is: $host\r\n";
?>


Maybe there is a better way to do this but right now this is all I could figure out... also I see some excellent new functions to do just something like this in one line but that's in PHP 5!
  #3  
Old 20-Dec-2003, 18:07
encoderX encoderX is offline
New Member
 
Join Date: Dec 2003
Posts: 2
encoderX is on a distinguished road
Talking

Hi
The php code you kindly worked out does great - I can see this been solved

I'd like it so the domain could be passed from a form input, I can see a light at the end of the tunnel...

Do you have a link please to the php 5 that might work?

I am greatful for your input so far.

Kind regards.
encoderX.co.uk
  #4  
Old 20-Dec-2003, 18:58
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

PHP 5 function: dns_get_record()


An interesting function in PHP 5:

http://www.php.net/manual/en/functio...get-record.php

I don't quite understand what you mean by:
Quote:
Originally Posted by encoderX
...I'd like it so the domain could be passed from a form input, ...
 

Recent GIDBlogNARMY by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP script to show last referrer url and top referrer to your site jrobbio MySQL / PHP Forum 6 22-May-2006 01:06
Where can I find web statistics script / software? rhino1616 Web Design Forum 2 02-Jan-2004 20:31
JavaScript Tutorial Part 1 pcxgamer Web Design Forum 2 01-Dec-2003 09:16
sms web sender script jrobbio MySQL / PHP Forum 1 11-Apr-2003 12:19
VALIDATING file types on an PHP upload script? JdS MySQL / PHP Forum 0 02-Jan-2003 07:58

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 06:23.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.