-1

I have a php with a form/text area, I do not want to use a button press to post data to some other PHP.

I am looking for some auto_post AJAX query which will put all the data that user has typed in the text box, into a $variable in the same php.

Something like this:

<?php
$checkbox.= '<input type="textbox" name="vehicle" value="" />';
echo "$checkbox<br>";
    $return = $checkbox;
    //$return should have all the data typed by the user
?>
halfer
  • 19,824
  • 17
  • 99
  • 186

1 Answers1

0

This is not possible without PHP as it is a serverside language, which means, that all code is processed before the document is sent to the Browser. Ajax and JavaScript however are Clientside languages, which first come to work when the Client recieved the document.

Working with php asynchronus can be reached as you already guessed by using Ajax. By sending information to a php script and printig it as a xml document you can run what you want to progress and read it on the original page again using Javascript.

But i suggest to read a tutorial on Ajax itself to get an idea of what to do, as this is a bit too much for a single Stackoverflow answer.

Here are some tutorials that might help you:

http://killerajax.com/

https://developer.mozilla.org/

T3 H40
  • 2,326
  • 8
  • 32
  • 43