0

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.

Jatin
  • 3,065
  • 6
  • 28
  • 42
Alan
  • 2,046
  • 2
  • 20
  • 43
  • Your question is not very clear. What is it that you are asking? – putvande Mar 31 '14 at 20:30
  • Since I am not actually leaving the page, what am I linking to? I don't want to create a ton of different PHP pages when I could just set the equivalent of "if ($_REQUEST['do'] == 'Options'){};" I just don't know what the equivalent is. – Alan Mar 31 '14 at 20:47
  • Thanks nderscore, I looked through that and if the info I needed was there, it went over my head. I edited my question to be more clear. – Alan Mar 31 '14 at 22:11

0 Answers0