Page 1 of 1
Some help on PHP code
Posted: Fri Jun 05, 2009 8:19 am
by bri552
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.
Re: Some help on PHP code
Posted: Fri Jun 05, 2009 9:55 am
by pickle
Moving to PHP -Code forum.
Re: Some help on PHP code
Posted: Fri Jun 05, 2009 11:35 am
by mikemike
What do you mean by 'resolve'? Get the IP address?
The first hurdle will be getting them into an array, which is easy. Use HTML arrays to name your textfields:
Code: Select all
URL: <input type="text" name="url[]" /><br />
URL: <input type="text" name="url[]" /><br />
URL: <input type="text" name="url[]" /><br />
URL: <input type="text" name="url[]" /><br />
URL: <input type="text" name="url[]" /><br />
URL: <input type="text" name="url[]" /><br />
URL: <input type="text" name="url[]" /><br />
URL: <input type="text" name="url[]" /><br />
URL: <input type="text" name="url[]" /><br />
...
All of these values will then populate the $_POST array:
Code: Select all
echo '<pre>'.print_r($_POST, true).'</pre>';
/* Produces something like:
Array(
[0] => google.com
[1] => yahoo.com
[2] => overture.com
)
Re: Some help on PHP code
Posted: Sun Jun 07, 2009 1:13 am
by bri552
i am not sure if i understood the code.
Wht i want is i want to rotate the domains the way they are entered
..
for eg.
yahoo.com ...then google.com etc
should resolved after a specific time.
Re: Some help on PHP code
Posted: Sun Jun 07, 2009 11:01 am
by mikemike
I'm not sure what you mean. You'll have to be a little bit more clear
Re: Some help on PHP code
Posted: Mon Jun 08, 2009 10:30 am
by bri552
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
Code: Select all
<SCRIPT language="JAVASCRIPT">
var Win;
var page_index=0;
var page = new Array();
page[0] = "http://mail.yahoo.com/";
page[1] = "http://www.daniweb.com/";
page[2] = "http://www.dutchfightclub.nl/";
page[3] = "http://www.dabs.com/";
page[4] = "http://www.lowestonweb.com/";
page[5] = "http://www.vantecusa.com/";
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>