Limiting access to a form/php

What I would like to do is to have a form on a webpage that everybody can see, but I want the php script from the line
<form action="do_something_spiffy.php" method="get">
to only function for logged in members. I've tried putting the php script within the s2member-files/access-s2member-level1 directory, but this resulted in a nasty error message even for logged-in members.
Also, the php script evidently is beyond the scope of being able to use functions such as
if (is_user_logged_in()) { // do spiffy stuff }
so I can't embed code into the php script to check the user's status.
Does anybody have any suggestions for how to achieve what I'd like to accomplish?
Thanks,
- David.
<form action="do_something_spiffy.php" method="get">
to only function for logged in members. I've tried putting the php script within the s2member-files/access-s2member-level1 directory, but this resulted in a nasty error message even for logged-in members.
Also, the php script evidently is beyond the scope of being able to use functions such as
if (is_user_logged_in()) { // do spiffy stuff }
so I can't embed code into the php script to check the user's status.
Does anybody have any suggestions for how to achieve what I'd like to accomplish?
Thanks,
- David.