latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

can I load PHP files inline?

Home Forums Community Forum can I load PHP files inline?

Tagged: ,

This topic contains 6 replies, has 3 voices. Last updated by  BoMember 3 years, 10 months ago.

Topic Author Topic
Posted: Monday Jul 23rd, 2012 at 7:25 pm #20017
Kirk Malay
Username: kirkmalay

I added PHP & htm to default Inline File Extensions

The htm file loads inline but the php downloads. I want the PHP file to show inline too.

I use the following syntax for the two variations.

http://www.guitarbasics.com/wp/?s2member_file_download=ptest.php&s2member_file_inline=yes&s2member_skip_confirmation

&

http://www.guitarbasics.com/wp/?s2member_file_download=ptest.htm&s2member_file_inline=yes&s2member_skip_confirmation

the only reason I want php so I can “include” headers and footers.

If I can get WP to load the inline htm file below the header and above the footer (where the content usually is) that would be great, but WP always loads the inline file above the header, content and footer. Is it supposed to do that?

Thanks for the great plugin, cant wait to master it and start using the pro

List Of Topic Replies

Viewing 6 replies - 1 through 6 (of 6 total)
Author Replies
Author Replies
Posted: Tuesday Jul 24th, 2012 at 3:55 pm #20098
Eduan
Username: Eduan
Moderator

Hello Kirk,

Haven’t seen this setup before so I’m not sure what the problem could be.

Do you have a plugin like the PHP Execution installed? If not, try that first. Also, you might be interested in putting the HTML in the page, but with a little twist, simply use conditionals so that the code can only run if the user has the required level, you can check the documentation under Dashboard -› s2Member® -› API / Scripting -› Advanced PHP Conditionals for more info.

Hope this helps. :)

Posted: Sunday Aug 5th, 2012 at 9:38 am #21183
Kirk Malay
Username: kirkmalay

Yes I have PHP plugin and all my PHP coding work great. I also use conditionals and they work great also.

http://www.mydomain.com/wp/?s2member_file_download=ptest.php&s2member_file_inline=yes&s2member_skip_confirmation

is the same as

http://www.mydomain.com/wp/wp-content/plugins/s2member-files/test.php&2member_file_inline=yes

and the s2member_skip_confirmation just stops the pop up from telling them a download is coming.

In wordpress > s2member > download options > inline file extensions >

it shows some possible extension: htm,html,pdf,jpg,jpeg,jpe,gif,png,mp3,mp4,flv,ogg,webm

but I see no PHP. I can add it to the list but it never serves a php page inline, it just sends the php file to my download folder. I can open it, but I want it to show up inline, on the screen like an actual post. htm,html,pdf,jpg, etc serves it inline right in a post looking page with the WP header and comment section, menu all included.

Can you serve php inline and have it show up on the screen as if it a post page? or does it only send it to your download folder?

Posted: Monday Aug 6th, 2012 at 11:24 am #21229
Eduan
Username: Eduan
Moderator

I’m not sure you can do this, I haven’t really tried it before.

Trt setting a variable equal to the contents of the file (loads up the file) and see if echoing that works.

Hope this helps. :)

Posted: Tuesday Aug 7th, 2012 at 8:08 am #21364
Kirk Malay
Username: kirkmalay

Brilliant idea, tried it and wp comeback with the membership options page, telling me I have to be logged in (but I am). With a few tweaks I might be able to pull that off.

thanks to Cristián (Support Rep), here is a solution, yay.

thanks for your help

Posted: Tuesday Aug 7th, 2012 at 12:20 pm #21383
Eduan
Username: Eduan
Moderator

Glad you solved your problem Kirk!

Sorry I wasn’t able to help much. :(

Posted: Tuesday Feb 19th, 2013 at 4:47 pm #42517
BoMember
Username: BoMember

Mind if I ask what the solution was?

Viewing 6 replies - 1 through 6 (of 6 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.