Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8895813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:53:07+00:00 2026-06-14T23:53:07+00:00

<input type=text onkeydown=domaincheck() /> <?php function domaincheck() { $recordexists = checkdnsrr(, ANY); if ($recordexists)

  • 0
<input type="text" onkeydown="domaincheck()" />

<?php
   function domaincheck()
   {
      $recordexists = checkdnsrr("", "ANY");
      if ($recordexists) 
         echo "The domain name has been taken. Sorry!";
      else 
         echo "The domain name is available!";
   }
?>

I want my php code to process the text input and say if it’s a valid domain or not. The only thing that doesn’t work is linking the input to the php.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:53:08+00:00Added an answer on June 14, 2026 at 11:53 pm

    That’s not how PHP works. You’re making a common thinking error, that a lot of beginners make, in that you seem to think that a client-side language like Javascript, can interact with a server-side language, such as PHP, in this fashion. This is due to a misunderstanding of the client/server and/or request/response model.

    When you request a web page with your browser (the client), your request is processed by the webserver (the server), that then returns a response, basically like this:

       Client (browser)             Server (webserver)
    ---------------------------------------------------
       Send page request   ----->    Parse request
                                     (execute PHP)
    
                                           |
                                          \|/
    
    Parse HTML response     <-----   Send HTML response
       (and execute                  (there will be no
        Javascript,                   more PHP code in
      if that was part                 this response)
      of the response)
    

    In other words: the client and server are two completely separated processes, that only communicate with each other based on a request/response principle.

    PHP cannot be executed on the client-side (save for the client-side version PHP-GTK, which we are not discussing here), and Javascript cannot be executed on the server-side (save for server-side versions of Javascript, which we are not discussing here). So, the PHP function domaincheck will not be available for the client to call, and the Javascript calls will not be received by the server.

    And so, if you don’t want to request a complete web page again, but merely have a Javascipt function request and receive the output of a PHP function, you’d have to let Javascipt make another request to the server again (‘in the background’, meaning: without completely replacing the whole page in the browser), and have PHP create a response again, this time with output that Javascript can handle. This is typically known as AJAX (Asynchronous JavaScript and XML). Although the response doesn’t have to be XML. A JSON response is very common. Fragments of HTML (or even complete HTML pages) are also possible.

    I’ll probably add an example for you at some point in the near future.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<form action = settings.php method = post> Student ID*: <input type = text name
I have a type of input text that has to trigger a function on
Here's an example of what I mean: I have an array: array('type'=>'text', 'class'=>'input', 'name'=>'username',
<form method = post action = <?php echo $_SERVER['PHP_SELF']; ?> /> Username:<input type =
How to work jquery autocomplete with select tag ? HTML <input type=text id=search onkeydown=autoCompleteByTag(this)
If a textarea or input (type text) element has focus in a HTML page
Hi in my input type text I want to call URL if user enters
I have an input of type text , from which I have already entered
I have the following HTML: <input type=email id=email> I want to type text into
I have an INPUT element of the TEXT type and I want to perform

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.