problems with temp. html from cgi-script

problems with temp. html from cgi-script

Post by <i.. » Sat, 03 May 1997 04:00:00



hi out there in www.servers.unix-land

i have an cgi-script wich genarates multiple htmls (for frames) on the fly!
i want to delete this files imidiatly after publishing!

i crate the files with:

echo "bla bla!">>$topframe
echo "bla bla">>$rightfile

cat $topframe.html

every thing works fine so far
now i want to add the line:
rm $topframe $rightfile
at the end of the script

wich results in:
file notfound!
on my www-client

i am using apache 1.28b (or something like this) on a linux-maschine
maybe there is something to configure in the httpd for this??

i actually generate the files as:
$$anyfile

and have a cronjob runnig which deletes each half an our all files older
then 10
minutes in the direktory
its not very elegant :(

anyone any ideas to help me???

 
 
 

1. calling CGI scripts from UNIX shell scripts->html

A question for all of you experts:

I am trying to create a www site which has a series of merchant pages
that are created from a database whenever someone visits that page.
While is it easy enough to create a cgi script (in Perl 5) that, when
passed an id, accesses the database and creates and returns an html
document with all of the text, graphics, etc variables replaced with
data from the database, this means that someone trying to access that
"page" from outside of our site has to enter a nasty URL (e.g.
www.oursite.com/cgiscript.cgi?nameofmerchant, at the very least.) In
order to create a nice neat url, and hopefully also allow the "BIG"
search engines to index those pages, I want to create a simple document
for each merchant that calls the cgi script with the correct variables
to generate the page.

I have tried SEVERAL possible solutions to this problem, none of which
work very well. For starters, there is no easy way to "call" a perl
script from within an html document in order to simply insert newly
generated html. I tried the <SCRIPT> tag, embedded in an html document,
which looks something like this:

<HTML>
<HEAD>
<META NAME="description"....
<META NAME="keywords"....
<BODY> <SCRIPT SRC="cgiscript.cgi?merchantid></SCRIPT></BODY>
</HTML>

If I name this script "a_merchant.html", it gets the job done. A person
could easily type the URL www.oursite.com/a_merchant.html and get a
generated page. There is one VERY bad side effect, however. If the
person hits 'back' on their browser, they get the calling html document
I typed out above, which then uses the <SCRIPT> tag all over again to
generate the page, resulting in a loop that is hard to get out of.

Another solution, it would appear, is to create a UNIX shell script,
such as index.cgi, and use it to call the generating perl script. Thus,
each merchant could have their own subdirectory on our site which would
contain an index.cgi unique to their needs. A sample of this shell
script follows:

echo "merchantid"|cgiscript.cgi

To view the page, one would use the URL www.oursite.com/a_merchant/,
the index script gets loaded automatically, it generates the page and
there it is.  The problem here has been that I can run the script
beautifully at the Unix command line, and it generates a beautiful bunch
of html, but I can not for the life of me get it to execute when typing
the same thing in my browsers location bar! Instead I get the lovely
"500 Internal Server Error" message.  A few facts: both scripts have had
their execute bits set (chmod 755). My host is running Unix BSDI BSD/OS
2.0.1, and I am using Netscape 3.01

Any help on either "solution" would be much appreciated. You can post
here or email me (remove the "REMOVE").
Thanks!

Steve

2. Bootting Bluecat3.0 linux on SBC 8260 boards

3. bash-script as cgi-script

4. pthreads, create after accept(), locking

5. Bash/CGI - - HTML call to Bash script

6. shut off completely?

7. How to redirect html requests to a single cgi script

8. Crash Dump

9. Netscape showing html code from cgi script (Apache Server)

10. Autenthication via HTML form and cgi or script

11. Free HTML form-to-email cgi script

12. Output from cgi scripts displaying as text not html formatted text

13. Urgent: howto run cgi-scripts out of html-pages