Lets say i have this form in form.php file.
<form action="process.php" method="POST">
<input type="text" name="message">
<input type="submit" value="Submit">
</form>
<span class="result"></span>
process.php contains
<?php
if(isset($_POST['message'])){
$message = $_POST['message'];
if(!empty($message)){
echo 'Your message: '.$message;
}else{
echo 'Please enter some message.';
}
}
Now if i want to display the output of process.php inside the form.php's span tag of class result i either need to use ajax, or session/cookie or file handling. Is there any other way?