<?php
$short_des="Harry Potter is a series of fantasy novels"; //initially short_description has this value
echo '<span><p>About:</p> '.$short_des.'</span>'; //initially i am printing short_des here but after cick of submit i want to update it
echo '<form class="make_long_form" method="post">';
echo '<input type="text" id="make_descrip_long" method="post" name="make_descrip_long" value="'.$post_read_more['id'].'">';
echo '<input type="submit" id="read_more_button" value="Show more">'; //this is the submit form
echo '</form>';
if(isset($_POST['make_descrip_long'])){
$short_description = "Harry Potter is a series of fantasy novels written by British author J. K. Rowling."; //after the click of submit i want to update the value of short_description and update it in the about echo above
}
?>
Ich denke, ich muss Ajax verwenden, um den Wert von short_des im Echo zu aktualisieren. Hilfe.Wie benutzt man Ajax, um ein bestimmtes Div nach dem Klick auf ein Submit zu aktualisieren?
Für diese Art von Aktion könnten Sie nur Javascript - es gibt keine Notwendigkeit für AJAX – Philipp
können Sie mir bitte sagen, wie soll ich es tun? –
Wenn Sie suchen, um den Inhalt dynamisch von einer anderen Seite zu laden, habe ich Ihnen gerade beantwortet, wie Sie dies mit jQuery und AJAX tun –