Hi. I can't get Front Page to execute PHP statements when I put them in the textarea block and set that block as the homepage for authenticated users. Specifically, this block is a customized page.tpl.php from the Marinelli 1.7 template. I am trying to get two sidebar columns to display only on the front page of my site, so I thought that a custom page.tpl.php was the way to go. Regular text, but not PHP calls, will work.

Can someone help me with this? I even tried the most basic function, phpinfo(), and it didn't work.

Comments

Phillip Mc’s picture

I'm confused. Are you pasting a customised page.tpl.php file into your front page settings for anon users?

Surely not?

archer007’s picture

No, authenticated users only. Anon users don't get to see any nodes at all. The trouble is that Front Page is working but apparently cannot execute PHP. I'd like to know if this is by design or error.

Phillip Mc’s picture

try this:

on the settings page for the front page.module, paste the following snippet into the text area provided for anonymous users:

<html>
<body>
<h1><?php print "Hello, anonymous users!" ?></h1>
<p><a href="user/login">link to the login page</a></p>
</body>
</html>
  1. Before saving your new front page settings...select the option FULL and check the ALLOW EMBEDDED PHP option.
  2. Clear your drupal cacge and browser cache.
  3. Logout.
  4. Have a look at your front page post back up here if you can see "hello anonymous users". You may need to click on refresh
archer007’s picture

Yeah, I wasn't allowing embedded PHP. I didn't see the checkbox for some reason.

Phillip Mc’s picture

Status: Active » Closed (fixed)