I am trying to build my first set of forms and having an interesting issue. I am used to using something like:
if ($_REQUEST['do'] == 'Options'){};
Where I can use the $_POST
to tell the page what set of instructions. Currently, however I am using JavaScript to pull up the content that I want without navigating away from the page. I don't have to do it this way, I am just trying to explore all the things I don't know :) Here is part of the JavaScript I am talking about:
<script>
$(document).ready(function(){
$( "#1" ).click(function() {
$.get( "settings.php", function( data ) {
$( ".contentarea" ).html( data );
});
});
});
</script>
It would get called by using
<a id="1" href='#'>Settings</a>
and then populate an area on the page marked by:
<div class="contentarea"></div>
So the question is, I have a page similar to this page:
http://themeforest.net/item/simpla-admin-flexible-user-friendly-admin-skin/full_screen_preview/46073
For simplicity sake, lets use that as an example, in the content area to the right there are a few icons (Edit, Delete, Edit Meta) and at the bottom is the Edit Selected.
If this was straight PHP in a frame, I would reload the page with something like ?do=delete&item=1
since this isn't in a frame, how do I have it show up in the same area without reloading the whole page and pass the equivalent info so I can build an IF statement?
I am trying to keep all the related code in the same PHP file instead of creating a new page for every little function.