I want to use the PHP snippet here: http://drupal.org/node/31536, to create a user list page on my site. I've copied and pasted the snippet code into a new content page. When I preview or submit the page, I get this error:

Parse error: parse error, unexpected '>' in /var/www/html/bikecalgary/includes/common.inc(1824) : eval()'d code on line 1

any idea why this occurs or how to solve it?

thanks
S

Comments

heine’s picture

This usually means a typo in the code. A missing ; ) or { can lead to complaints...

Best paste the code here between PHP tags so people can take a look.

Is your first line <?php

--
Tips for posting to the forums.
When your problem is solved, please post a follow-up to the thread you started.

heine’s picture

The code is ok. But from the comment you made on that page the error is clear: set the filter to PHP code, not FULL HTML + CODE.

Full html introduces p and br tags; which is never a good idea in code.
--
Tips for posting to the forums.
When your problem is solved, please post a follow-up to the thread you started.

midtoad’s picture

hiding head in shame...

yes, there was a space between ? and php, so the code wasn't recognized as such. This became evident when I pasted the php code into my SciTE editor and compiled it; the syntax error was the same as on my site.

Now my snippet has an empty output, but no errors. So all I need to to do now is edit my snippet until I get some output. Thanks again.
S