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.

Serving member-files inline with URL argument

Home Forums Community Forum Serving member-files inline with URL argument

This topic contains 6 replies, has 2 voices. Last updated by  Eduan 3 years, 9 months ago.

Topic Author Topic
Posted: Friday Mar 22nd, 2013 at 6:17 am #45469
Richard Napier
Username: ODE

Hi.

Is it possible to have a link to a file in the member-files secure folder, and in that URL to pass url arguments to the page.

For example, I have xyz.html in the secure folder. I create a link using the secure-files shortcode and serve it inline, all works fine.

But I actually want the url to be “xyz.html?variable=X&variable2=y” or something similar. When I try that, it breaks and I get a 404 error.

To be as specific as possible, the URL I am trying to pass is for a Learning Record Store so it contains plenty of text for authentication, user info, lesson info and so on. It works fine outside of the s2member scope.

Is this possible or have I gone wrong somewhere.

List Of Topic Replies

Viewing 6 replies - 1 through 6 (of 6 total)
Author Replies
Author Replies
Posted: Friday Mar 22nd, 2013 at 11:02 am #45498
Eduan
Username: Eduan
Moderator

I see what you mean.

Well I’m not sure if this is possible or not, however the fact that you’re getting errors tells me it’s not possible by default.

I’ll ask Jason and see what he has to say about this. :)

– Eduan

Posted: Thursday Mar 28th, 2013 at 10:08 pm #46015
Eduan
Username: Eduan
Moderator

Here’s what he answered:

Passing additional query string arguments to a protected file is possible.

For example: http://www.example.com/wp-content/plugins/s2member-files/example.php?hello=world

However, parsing them inside the file is NOT possible, because PHP code is not executed by s2Member® when the file is being served. We do not attempt to evaluate any PHP code in the file being served to the customer.

In other words, this would NOT work inside the protected file.

However, you could parse the query string arguments using JavaScript maybe.
http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values

Posted: Friday Mar 29th, 2013 at 5:41 am #46029
Richard Napier
Username: ODE
Posted: Saturday Mar 30th, 2013 at 11:10 am #46140
Eduan
Username: Eduan
Moderator

What Jason is trying to say is that you can give the file arguments, but the file will not use them. Basically.

So actually there’s no use to giving it arguments, lol.

– Eduan

Posted: Monday Apr 1st, 2013 at 7:00 am #46269
Richard Napier
Username: ODE

Eduan / Jason

Thanks to you both for the definitive reply. I don’t have the functionality I need, but I got a straightforward and fast reply from you, which is the next best thing

Have a great day

Posted: Tuesday Apr 2nd, 2013 at 10:06 pm #46428
Eduan
Username: Eduan
Moderator

Glad I was able to help Richard. :)

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.