<?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
}
?>
Je pense que je dois utiliser ajax pour mettre à jour la valeur de short_des dans l'écho. Aidez-moi.comment utiliser ajax pour mettre à jour un div particulier après le clic d'un soumettre?
Pour ce type d'action, vous pouvez simplement javascript - il n'y a pas besoin d'ajax – Philipp
pouvez-vous s'il vous plaît dites-moi comment dois-je faire? –
Si vous cherchez à charger le contenu de manière dinamique à partir d'une autre page, je viens de vous répondre sur la façon de le faire en utilisant jquery et ajax –