Help with basic CGI project?

J. Landman Gay jacque at hyperactivesw.com
Wed Jun 18 14:02:13 EDT 2008


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