-2

I have a simple website that has two columns. One for the maincontent and on the right a small column div class="login" that has a login form. There is a link there named register. When the user clicks it he gets sent to createuser.php. What i want is for that entire createuser.php page to be displayed inside the div called maincontent: how would i do that?

The div:

<div id="maincontent">
i want the `createuser.php` (just a form inside it) displayed here so i assume there
has to be something like <?php include 'createuser.php' ?> inside here but only
display it after the user has clicked "register"-button.
</div>

I do not want to use ajax.

  • Try AJAX.... It can help – Crazy Programmer Feb 18 '14 at 09:30
  • "This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself." – Havelock Feb 18 '14 at 09:31
  • [See this](http://stackoverflow.com/questions/18440241/load-div-content-from-one-page-and-show-it-to-another). It might help you – Vikas Arora Feb 18 '14 at 09:33
  • Welcome on StackOverflow! Are you looking for a way to include ``createuser.php`` into another page? Then templating (search for it) might what you are looking for. In any case: Please make your question more specific! You can always edit your question (or leave a comment). The issue people are having is that it is not entirely clear what your problem is, but hopefully we can get this sorted out. – Jonas Schäfer Feb 18 '14 at 10:13
  • Any reason you don't want to use AJAX? You realise the page has to reload if you don't want to use AJAX, right? – BT643 Feb 18 '14 at 13:39

1 Answers1

1

Are you willing to use jQuery?

$("#id_of_register_link").click(function() {
  $("#maincontent").load("path/to/createuser.php");
});
BT643
  • 3,495
  • 5
  • 34
  • 55