Add php code to page

I got a script from phpjabbers that lets me have members log-into a members only section of the site(after paying a registration fee) - it works quite well expect for one section - when you use the admin part of the script you get a small piece of code that re-directs visitors if they are not logged in. This code needs to be run before anything else on the page. I tried adding it via an HTML block in the header of the page but it doesn't work so I figure I need to ad it to the page some other way but I have no clue how to do this.
They sent me a sample page that features the code which I have attached here and hpoing someone here can help me.

1 Attachment

View Replies:
JohntheFish replied on at Permalink Reply
As this is a complet application that is not designed to work with concrete5, the simplest way to integrate it with a concrete5 site would be to code it into a 'single page'.
mostrim replied on at Permalink Reply
Thanks for the reply
I tried following the instructions in the documentation - copied the example page to the single_pages folder - added it on the dashboard, it showed up and showed up on the navigation of my website but was a complete blank page .
Copied it to the themes folder of the slate theme I use - still blank - I deleted the file in the single_pages folder - now visiting the page shows the theme colours, headers etc. but a page full of errors. So deleted all and started again.
Decided I'd try copying a view.php file from my theme/pagelist folder, renamed it, added in the custom code, saved it to the single_pages folder, added it via the dashboard
same results
At this stage I decided I am way out of my depth here and have abandoned all my efforts.
I have a page I created for the members only area of my site it works as is but won't redirect if a user tries to access it without a login.
Unless you have a more idiot proff method for em to do this then it will have to remain as is
mostrim replied on at Permalink Reply
Okay I have added a single page to my site - called membership by creating a folder in the singlepages folder called membership - this makes no sense to me - it looks and acts like any other page on my site.
I have read and re-read the documentation but i am none the wiser. Can anyone help out here?