Note that there are some explanatory texts on larger screens.

plurals
  1. POforms to update database in div=content
    text
    copied!<pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="./js/jquery.blockUI.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function(){ $(".menuLink").click(function(){ $('#content').block({ centerY: 0, css: { top: '40px', left: '', right: '10px' }, message: '&lt;img src="./Images/ajax_loader.gif" /&gt;&lt;br /&gt;&lt;h3&gt;Loading...Please wait.&lt;/h3&gt;' }); $.ajax({ type: "POST", url: $(this).attr('href'), cache: false, success: function(html){ $("#content").html(html); } }); }); $(document).ajaxStop(function(){ $('#content').unblock(); }); }); &lt;/script&gt; </code></pre> <p>This is the code I have for geting links in div id=menu when clicked they load the php file into div id=content ahref I have is here.</p> <pre><code>&lt;p&gt;&lt;a class="menuLink" href="Test.php" onclick="return false;"&gt;Wall&lt;/a&gt;&lt;/p&gt; </code></pre> <p>Now the class and onclick with script above is what makes the Test.php load in div id=content when that link is clicked on div id=menu.</p> <p>Below is the script in Test.php</p> <pre><code>session_start(); include_once("connect.php"); include_once("functions.php"); if($_POST['WallSubmit'] &amp;&amp; $_POST['Wall']){ $wall = makesafe($_POST['Wall']); mysql_query("INSERT INTO `Wall` (`ID`, `Username`, `MessageBy`, `Date`, `Message`) VALUES ('', '', '$username', '" . time() . "', '$wall')"); } &lt;form method='post'&gt; &lt;table class="default" style="width: 80%" align="center"&gt; &lt;tr&gt; &lt;td class="subheader"&gt;Wall&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="content"&gt;Post a comment.&lt;br /&gt;&lt;textarea name='Wall' id='Wall' style='width: 99%; height: 110px;'&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br/&gt;&lt;center&gt;&lt;input type='submit' value='Post' name='WallSubmit' /&gt;&lt;/center&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;Latest Comments.&lt;/td&gt; &lt;/tr&gt; &lt;/td&gt; &lt;/table&gt; &lt;/form&gt; </code></pre> <p>Now the problem I am having is once I have clicked wall on menu as can see in href it loads into div id=content no problem at all so now the Test.php is displayed in content div but now when I fill in that form on Test.php it just refreshes to the default content page and it does not update the database if it doesnt refresh to that default content there then the button does not do anything when click, Now I know the coding works for the database and form as it's been tested in a framed layout and also works if I set Test.php to the default content page, will put default content as I have in page.</p> <pre><code>&lt;div id="content" class="auto"&gt; &lt;?include_once("Test.php");?&gt; &lt;/div&gt; </code></pre> <p>What is trhe solution for this? I know it sounds abit confusing but all I want is to figure out once I click Wall on menu and it loads Test.php into div id=content how to get the form in Test.php to do it's job lol.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload