0
<?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
}
?>
私はエコーのshort_desの値を更新するためにajaxを使用する必要があると思います。助けて。送信のクリック後に特定のdivを更新するためにajaxを使う方法は?
この種のアクションでは、JavaScriptだけでいいです.Ajaxの必要はありません。 – Philipp
どうすればいいですか教えてください。 –
別のページからコンテンツをdinamicallyロードする場合は、jqueryとajaxを使用してこれを行う方法についてお答えしました。 –