Hi,
I am trying to create a page where:
a user can enter domains which he want to resolve.
for an instance say:
user1 enters
yahoo.com
google.com
msn.com
nbsc.com
The script should accept this domains may be in array and then resolve one by one may be in a frame.
Can any one help me how to start with this.
php code help
Started by bri552, Jun 05 2009 05:29 AM
10 replies to this topic
#1
Posted 05 June 2009 - 05:29 AM
|
|
|
#2
Guest_Jordan_*
Posted 05 June 2009 - 06:03 AM
Guest_Jordan_*
You can use a textarea to accept input via a form. When the user submits you can split by linebreak to create an array of domains. Alternatively, you could use multiple <input type="text"> boxes and have the name an array (txtDomain[]). When the user wants to add more, use JavaScript to create a new text box.
Once you receive the data, you can loop through the domain name array and use gethostbyname() to retrieve the IP.
Once you receive the data, you can loop through the domain name array and use gethostbyname() to retrieve the IP.
#3
Posted 05 June 2009 - 06:07 AM
can u help me with an example
#4
Guest_Jordan_*
Posted 05 June 2009 - 06:16 AM
Guest_Jordan_*
index.php
domain.php
The code above does no error checking on the post data nor does it format that output. This is just an example as you request. This was also untested so it may or may not work.
<form name="domainsubmit" method="POST" action="domain.php"> <input type="text" name="domain"> <input type="submit" value="Resolve"> </form>
domain.php
<?php $domain = $_POST['domain']; // Resolve it and echo it echo gethostbyname($domains);
The code above does no error checking on the post data nor does it format that output. This is just an example as you request. This was also untested so it may or may not work.
#5
Posted 08 June 2009 - 07:33 AM
take a look at the below code:
The url enter are explicitly used.
I want to know is it possible to let user choose the domain he want to resolve.
The below code is javascript.
So do you know if the above objective can be achieved in PHP
Thankyou for the help
The url enter are explicitly used.
I want to know is it possible to let user choose the domain he want to resolve.
The below code is javascript.
So do you know if the above objective can be achieved in PHP
Thankyou for the help
<SCRIPT language="JAVASCRIPT">
var Win;
var page_index=0;
var page = new Array();
page[0] = "url";
page[1] = "url";
page[2] = "url";
page[3] = "url";
page[4] = "url";
page[5] = "url";
function next_page()
{
page_index++;
if (page_index == 6)
page_index = 0;
Win.location.replace(page[page_index]);
}
</SCRIPT>
</head>
<body>
<h1>Auto Start Page Rotator</h1>
<SCRIPT language="JAVASCRIPT">
Win=window.open(page[0], 'Win','resize=yes,toolbar=yes,status=yes,scrollbars=yes,screenX=0,screenY=0,width=1000,height=666')
setInterval("next_page();",8000);
</SCRIPT>
<input type="text" name="url[]" /><br />
</body>
Edited by WingedPanther, 08 June 2009 - 07:35 AM.
add code tags (the PHP sheet)
#6
Posted 08 June 2009 - 07:36 AM
I'm not clear what you're trying to accomplish.
#7
Guest_Jordan_*
Posted 08 June 2009 - 08:03 AM
Guest_Jordan_*
What am I looking for?
#8
Posted 08 June 2009 - 08:52 AM
seems like he wants to create a page, which opens another window, and in that window, loops the urls from a list with a delay
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
I study Information Systems at Karlstad University when I'm not on CodeCall
#9
Posted 08 June 2009 - 12:44 PM
This sounds like a full freelance job :P
Checkout my new forum! http://adminreference.com/
#10
Posted 08 June 2009 - 09:56 PM
yes that's right .any suggestion on how to accept url from users.
#11
Posted 10 June 2009 - 03:17 AM
Guys, ne help on the above topic


Sign In
Create Account

Back to top









