I\'m trying to execute a PHP function in the same page after the user enters a text and presses a submit button.
The first I think of is using forms. When the user s
Here is a full php script to do what you're describing, though pointless. You need to read up on server-side vs. client-side. PHP can't run on the client-side, you have to use javascript to interact with the server, or put up with a page refresh. If you can't understand that, there is no way you'll be able to use my code (or anyone else's) to your benefit.
The following code performs AJAX call without jQuery, and calls the same script to stream XML to the AJAX. It then inserts your username and a
in a div below the user box.
Please go back to learning the basics before trying to pursue something as advanced as AJAX. You'll only be confusing yourself in the end and potentially wasting other people's money.
".$_GET["user"]." "; //output an xml document.
}
if(isset($_GET["user"])){
test();
} else {
?>
Test