Help with basic CGI project?
John Patten
johnpatten at mac.com
Thu Jun 19 11:06:19 EDT 2008
Thanks Jacqueline!
I did find the solution in a post you had made earlier in the archives a few years back.... Store your stack, in this case, the data.rev stack, outside of the cgi-bin folder. I did that and everything worked as it should.
As I was trouble shooting this, i did remember seeing something about "...can't open up backup stack..." but didn't think anything of it as I was trying all kinds of contortions to get this to work and thought little of it. Searching through the archives lead me to your previous post. I gota remember to search those archives more often when I have a problem! ;-)
Thank you!
John Patten
Message: 11
Date: Wed, 18 Jun 2008 13:02:13 -0500
From: "J. Landman Gay" <jacque at hyperactivesw.com>
Subject: Re: Help with basic CGI project?
To: How to use Revolution <use-revolution at lists.runrev.com>
Message-ID: <48594DA5.4050509 at hyperactivesw.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
John Patten wrote:
> Couple things I?ve noticed that seem a bit strange. First, if I have
> multiple ?put? commands pulling text from fields on different cards,
> the rev cgi only will pull the text from the first card.
Not sure why that would be, it should work. You could try adding a
"start using stack theStack" command near the top of the script somewhere.
> If I add
> multiple fields to the first card, and pull the text from these
> fields, all on one card, it will pull the text out of the fields. It
> is as if the rev cgi will not go beyond the first card of the
> data.rev stack.
>
> Also, if I increase the number of ?create new card? commands in the
> text cgi script, it will report back that it created the cards, but
> if it does, they are only temporary and not saved.
The cgi does not run as you, it runs as another user ("nobody" I think,
but I'm not certain.) At any rate, the permissions for the stack are set
to only allow you, the admin, to write to the file. You need to change
that to allow anyone to write to the file.
This is a bit of a security concern and most ISPs do not allow writing
anything to files in a cgi folder. A better way to handle this is to
store your data stack somewhere else on the server -- even in your own
user folder -- and provide a long file path to the stack to open it. If
you are just experimenting on your own machine and don't intend to use
the script elsewhere, then it's fine to violate security of course.
Rev will accept a full path as a stack reference, so it is legal to say:
go stack "/Users/myname/myfolder/data.rev"
Regardless of where you store the data file, it needs to have
permissions set for anyone to write to it.
Just an aside: the destroystack property is permanent, you don't have to
reset it once the stack has been created and saved the first time.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list