<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>PHP links</title>
<?php
echo '<div style="background-color:#ccc; padding:20px">' . $_POST['message'] . '</div>';
?>
<style type="text/javascript">
// prepare the form when the DOM is ready
$(document).ready(function() {
// bind form using ajaxForm
$('#htmlForm').ajaxForm({
// target identifies the element(s) to update with the server response
target: '#htmlExampleTarget',
// success identifies the function to invoke when the server response
// has been received; here we apply a fade-in effect to the new content
success: function() {
$('#htmlExampleTarget').fadeIn('slow');
}
});
});
</style>
</head>
<body>
<form id="htmlForm" action="html-echo.php" method="post">
Display List of Links <input type="text" name="message" value="Hello HTML" />
<input type="submit" value="Submit links" />
</form>
</body>
</html>
I am trying to get the results displayed on the same page without having to create a .php page and having the results displayed on a separate page. It's an application where a user can submit any type of link and have the results show up on the page.
Is there a way I could save the results for later reference? Keep the results displayed when the page is refreshed?