I am trying to submit a form post to a php page (which has dummy vars) then return the results and display them in the 'userinfo' div on the same page. I suspect I need to post the information to the same page or use Ajax but unsure on how to achieve this.
A few hours of trawling the web hasn't provided any decent examples of what I am trying to do.
any help appreciated:
Anyway here is the code:
<form name="Find User" id="userform" class="invoform" method="post" action="includes/find.php" />
<div id ="userdiv">
<p>Name (Lastname, firstname):</p></label><input type="text" name="username" id="username" class="inputfield" />
<input type="submit" name="find" id="find" class="passwordsubmit" value="find" />
</div>
</form>
<div id="userinfo"><b>info will be listed here.</b></div>
php dummy vars:
<?php
$user=$_POST['username'];
$username="username";
$gg_groups="gg_usergroups";
$enabled="True";
$result = array(
'username' => $username,
'user' => $user,
'usergroups' => $gg_groups,
'enabled'=> $enabled
);
echo json_encode($result);
?>