Jump to content

damaya

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

damaya's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ahhh, alright, I get that part now, but the part I am still lost on is how, after including lookup.php, do I use the values from lookup.php to populate my text fields? I am used to Perl, where I return a value (array, hash, scalar), and then use that value to populate the form... If it can validate the domain it returns TRUE + All records found. If not, it returns FALSE. Then, in index.php, If it returns TRUE it populates all text fields with the records, and if it returns FALSE it should have a box below that says something like "Sorry, unable to find domain."
  2. In index.php I have this: <form action="lookup.php" method="POST" class="form"> <label for="domain">Domain Name</label> <div class="domain_div"> <input name="domain" type="text" class="domain_tb" id="domain" value="domain" /> </div> <div class="button_div"> <input name="Submit" type="button" value="Look Up" class="buttons" /> </div> </form> Now, in my lookup.php file I have this: <?php ini_set('display_errors',1); error_reporting(E_ALL|E_STRICT); $domain = $_POST['domain']; // First let's check if domain is valid (exists) $ip = gethostbyname($domain); if($ip === $domain) { return ???; } // First get all records related to root domain // Get A Records First $dnsr = dns_get_record($domain, DNS_A ); for($i = 0; $i < count($dnsr); $i++){ echo $dnsr[$i]["host"].'<br>'; echo $dnsr[$i]["ip"].'<br>'; echo '<br>'; } ?> Now, how do I get everything from lookup.php back into index.php forms? Do I return it back in and handle it there? How to do that? Is there a better way to do this?
  3. Hi guys, I am trying to figure out how to do something here in PHP... I have a form, with a box at the top where user can enter a domain name, under this box there is a submit button and then a bunch of boxes below the submit button for all the records related to that domain. I want a user to enter a domain, hit submit, PHP script looks up all records related to the domain, and then returns them back to main index.php and populates all the record fields below the submit button. Any guidance on how to do this would be appreciated. I can clarify further if needed, just let me know!
  4. damaya

    regexp

    You should be able to match like this: 2009/06/28 22:54:59 administrator 13 1 /^(\d{4})\/(\d{2})\/(\d{2})\s(\d{2})\d{2})\d{2})\s(\w+?)\t(\d+?)\t(\d+)$/ A quick Perl script test: #!/usr/bin/perl use strict; use warnings; my $test="2010/06/28 22:54:59 administrator 13 1"; my @test = $test =~ /^(\d{4})\/(\d{2})\/(\d{2})\s(\d{2})\d{2})\d{2})\s(\w+?)\t(\d+?)\t(\d+)$/g; foreach my $result (@test) { print "$result\n"; } Resulted in this output: 2010 06 28 22 54 59 administrator 13 1
  5. So, I would have jQuery start the PHP script that does the DNS lookup when the YES button is checked, and jQuery populate the fields after the lookup returns results? I'd love to be pointed in the direction of a good tutorial or a decent start, because I am an epic failure at Google when it comes to trying to figure this one out.
  6. I have a text area where the user types in a domain, and below that I have two radio buttons, YES and NO, and this is what I want to happen, but not sure how to do it... If radio button YES is selected, then a lookup on the given domain happens, and a bunch of text boxes appear on the page. If the lookup of the domain finds any records (A, MX, CNAME, etc), then those fields are populated with the found values. If nothing is found, then the text fields are left blank. I'm just not sure I can assign an action to a radio button like that without the user having to hit a submit button... If radio button NO is selected, then a submit button appears on the page. The part I am really having trouble wrapping my mind around is having that radio button perform the action of checking the DNS records for the domain and then populating the fields on the same page without having to hit submit. Please let me know if there are any good tutorials on this, or anything to at least get me on the right track. I greatly appreciate it, thank you!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.