How do I place the registration form in the front page? I am using Drupal 7.

I clicked on Structure > Block > Add Block; I filled in the block title and block description. In the block body, I put in this code.

&lt;?php
  $_GET['q'] = 'user/register';
  print drupal_get_form('user_register');
?&gt;


I set the text format to PHP (PHP wasn't in the drop down options of text formatting so I added PHP to it), and I clicked on save block.

The block is now created but it's just empty. I can't see any sign up form.

Can someone please put me through? I'm new to Drupal.

I just discovered that I had to activate PHP Filter in core modules (administration > modules). So when I activated PHP Filter module, the registration block I created now shows the word "Array", and also some error in the log.


  Notice: Undefined index: user_register in drupal_retrieve_form() (line 764 of C:\xampp\apps\drupal\htdocs\includes\form.inc).
  Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'user_register' not found or invalid function name in drupal_retrieve_form() (line 799 of C:\xampp\apps\drupal\htdocs\includes\form.inc).
  
  Notice: Array to string conversion in eval() (line 3 of C:\xampp\apps\drupal\htdocs\modules\php\php.module(80) : eval()'d code).


However, the "create new account and login" menu is now showing; it is only not showing in the block I created for it. What is showing in the block is "Array"; when I click on either "register" or "log in," it takes me away from the front page (to the register page).
The user register form id is user_register_form. Please try it like:

$form = drupal_get_form('user_register_form');
print render($form);