View Full Version : SSI and the "Suggest this site" thingy
Bekariso
12-12-1998, 07:59 PM
Okay, I'm beginning to learn how SSI actually works, and I came up with a question. If you use the "Suggest this site" code thingy in an include source file, so that the "Suggest this site" link will show on every page with the include, will the "Suggest" thingy cope and suggest the page that calls the include, or will it suggest just the include bit, or will it just not cope at all?
Just wondering. http://www.aota.net/ubb/wink.gif
------------------
Bekariso
susogi.net/Bekariso (http://susogi.net/Bekariso)
*** We prefer to remain anomalous ***
pqwabbit
12-12-1998, 10:22 PM
hhm i duno but sure wuldmake my liofe easier
Lea
When you use a piece of code in an 'include file' the string you use on your HTML doc is replaced with the code in the file itself BEFORE the page ever hits the browser.
E.g. the browser and the script will never know it was part of an include file.. it only knows that it is part of the page, as such it will work just fine http://www.aota.net/ubb/smile.gif
Give it a try http://www.aota.net/ubb/smile.gif
Deb
------------------
Unlocking the Power of the Internet!
www.FutureQuest.net (http://www.FutureQuest.net)
Bekariso
12-13-1998, 06:26 PM
Yep, worked great! Thanks!
Very cool.
Reiya
Javier Mosqueda
12-31-1998, 06:05 PM
I tried SSI and noticed the <!--#include or <!--#echo are replaced with plain text (which makes visitors to wonder how the exact time and date got there http://www.aota.net/ubb/smile.gif ) Great Tool!!
My question is about how heavy is that to the server, do you -FQ- see any "suffering" of your machines from this kind of work?
If one wanted to show different pictures every time the page is loaded, what would be the easiest way? are you are planning to provide a tool to do so?
(perhaps a CGI that takes 3 parameters, first is wildcard for the picture's filename, like PICT??.GIF, second NEXT/RANDOM, this is if the number generated by the CGI is the next number in a sequence or just a random one, third, the LIMIT or maximum number possible to be generated. To keep control of the sequence, maybe a plain file on the Xdomainname directory, where the previously generated number is stored assuring that the next one will be actually the next in the sequence http://www.aota.net/ubb/wink.gif
I program in Pascal for Windows, does it help to make a CGI? Should I submit source and .EXE to you so you transform it or how does it work?
------------------
Javier Mosqueda
crystalking.com (http://crystalking.com)
Javier Mosqueda
12-31-1998, 06:09 PM
I tried SSI and noticed the <!--#include or <!--#echo are replaced with plain text (which makes visitors to wonder how the exact time and date got there http://www.aota.net/ubb/smile.gif ) Great Tool!!
My question is about how heavy is that to the server, do you -FQ- see any "suffering" of your machines from this kind of work?
If one wanted to show different pictures every time the page is loaded, what would be the easiest way? are you are planning to provide a tool to do so?
(perhaps a CGI that takes 3 parameters, first is wildcard for the picture's filename, like PICT??.GIF, second NEXT/RANDOM, this is if the number generated by the CGI is the next number in a sequence or just a random one, third, the LIMIT or maximum number possible to be generated. To keep control of the sequence, maybe a plain file on the Xdomainname directory, where the previously generated number is stored assuring that the next one will be actually the next in the sequence http://www.aota.net/ubb/wink.gif
I program in Pascal for Windows, does it help to make a CGI? Should I submit source and .EXE to you so you transform it or how does it work?
------------------
Javier Mosqueda
crystalking.com (http://crystalking.com)
Terra
12-31-1998, 07:42 PM
Nah - SSI / xSSI / PHP3 are all built into the Apache daemon... CGI does have extra startup/teardown resource hit though...
As far as the second part, what I can suggest is looking at various rotating banner scripts and massaging it to your needs...
--
Terra
sysAdmin
FutureQuest
Javier Mosqueda
12-31-1998, 08:00 PM
¿? Where can I see such scripts?. I saw the download.com (http://download.com) page which has nice changing ads every time one calls that URL, but the source code of the page shows that the page was made on the fly with specific picture names every time. Is there a script for a thing like that? Thanks.
------------------
Javier Mosqueda
crystalking.com (http://crystalking.com)
Hi Javier,
You may want to check out this link
http://www.cgi-resources.com
and
http://www.freecode.com
Lots of good ready made free scripts at both of those links... you'll find many different types to choose from there
Hope this helps
Deb
Javier Mosqueda
01-01-1999, 11:46 AM
Good, the one I liked the most was under "freecode", and it is: http://www.firststep.com.au/software/randtxt.html .
It shows either text and/or pictures randomly from a database that can be within the same -or in a separate file- .html file that calls the CGI.
The code given is in Perl and the little changes are a) to indicate where you have Perl in the server, b) to modify a line where my e-mail is to be given in case of failure of the program. Also some permisions are needed for the file to be accesible, etc.
Questions:
a) am I allowed to run CGI's like this?
b) I read the installation instructions on that little program, what should be the proper procedure said by the owners of this server?
------------------
Javier Mosqueda
crystalking.com (http://crystalking.com)
Hi Javier,
The instructions they give for the script seem to be perfect for this server http://www.aota.net/ubb/smile.gif
Yes you can run scripts like this with your account...
Follow the instructions just as they give them to you (check your activation letter for the correct paths...)
All should work just fine.. if you have any problems just let us know.
Deb
pqwabbit
01-01-1999, 01:08 PM
Hey Javier - haha for the lopngest time I thought yuor url read cry stalking rather than crystal king hahaha yeeesh no wonder I was confused! but when I look at it my inclinaion is to see cry-stalking still
doh!
please excuse me Im a bit loopy
Lea
Javier Mosqueda
01-01-1999, 07:49 PM
First to Lea: That was my own feeling too and before registering that name I asked the FQ Mgrs about they opinion on different possibilities (crystal-king, crystal.king, etc.), but because the tendency is to type all together, the common conclussion became crystalking, in any case, it does a double job, keeps the minds "loopy" as you say and that helps my sales of Wood that again has nothing to do with Crystals; "Crystal"s comes from other of my products, "Fruit Crystals", so again keep the mind loopy. So you don't have to be sorry, I need my clients -and friend energies- to keep loopy on my company! http://www.aota.net/ubb/smile.gif
Now, to where I'm being loopy http://www.aota.net/ubb/frown.gif, Deb, I got lost with the PATHS to call the CGI; from the Activation Letter:
3) Linux/Unix Server specific instructions
*The full path to your directory is /big/dom/xcrystalking/www/
*The full path to your cgi-bin is /big/dom/xcrystalking/cgi-bin/
*The path to Perl is /usr/bin/perl or /usr/local/bin/perl either will work fine
*The path to Sendmail is /usr/lib/sendmail
*The CGI Debugging Logs are in /big/dom/xcrystalking/logs_cgi/
The CGI asks for a base path at the begining, I get lost in this: /cgi-bin/ and /www/ are both under /xcrystalking/, so what should the base path in the CGI header be up to /xcrystalking/ or up to /www/?
Then in the HTML, I need to call the CGI, but the HTML code is in a file inside the /www/ and how should I call the /cgi-bin/ from there:
"../cgi-bin/random.pl/source.htm" ?
(the two dots to indicate parent directory, can I use them?)
(random.pl is the CGI and source.htm is the database with the texts and images from where the CGI will pick the random info)
From the same activation letter, what is "Sendmail"?
Debuggin Log:
a) do I need to compile the CGI or is that Perl text file all is needed.
b)is this CGI log being filled every time the CGI is executed or only when it has errors and is tried to be executed.
thanks
------------------
Javier Mosqueda
crystalking.com (http://crystalking.com)
The CGI asks for a base path at the begining, I get lost in this: /cgi-bin/ and /www/ are both under /xcrystalking/, so what should the base path in the CGI header be up to /xcrystalking/ or up to /www/?
For the files that are in the cgi-bin or when they are asking for the full path to the cgi directory you use /big/dom/xcrystalking/cgi-bin/
For the files outside of the cgi-bin (images etc) or where they ask for the full path to your directory you would use /big/dom/xcrystalking/www/
Then in the HTML, I need to call the CGI, but the HTML code is in a file inside the /www/ and how should I call the /cgi-bin/ from there:
"../cgi-bin/random.pl/source.htm" ?
From inside the HTML you can simply use /cgi-bin/random.pl
From inside the cgi (.pl file) to call the source.htm you would use /source.htm
(the two dots to indicate parent directory, can I use them?)
Yes you can use .. if you like.
From the same activation letter, what is "Sendmail"?
Sendmail is a Mail Transport Agent. For cgi-scripts that will be emailing you, such as form mails etc... they will often times ask for the path to sendmail.
Debuggin Log:
a) do I need to compile the CGI or is that Perl text file all is needed.
The perl text file is all you need.
b)is this CGI log being filled every time the CGI is executed or only when it has errors and is tried to be executed.
Only when there are errors... consider it a Script Error Log...
Hope this helps
Deb
[This message has been edited by Deb (edited 01-01-99).]
Javier Mosqueda
01-02-1999, 10:57 AM
Not yet Deb.
According to the instructions of the creator, "$base" clause in the CGI has to point to the /www/ as it is "where the HTML" file is located".
I'm calling the CGI from the URL input line of the browser:
http://crystalking.com/cgi-bin/randtxt.pl/tester.htm/
The filename to be processed is tester.htm and the syntax to call it is like that, with slash beween the "randtxt.pl" and "tester.htm".
The CGI log shows the result.
But when I call the CGI without the filename, the log shows that the CGI was found and some error happened.
In the site where I found it shown above, the CGI is running properly I just took the script, changed the $email and $base (as the Perl location in the server was right), put it in the CGI-BIN directory and place the .htm file in the /www/ dir with all other files I had there. The syntax of the instructions inside .htm is simple.
...
------------------
Javier Mosqueda
crystalking.com (http://crystalking.com)
Terra
01-02-1999, 01:04 PM
Hello Javier,
I looked at the script and it has 3 problems...
1) #!/usr/bin/perl -- needs to be at the very top of the file...
2) It has the embedded 'CRLF' problem...
For more info on #2, please view:
www.aota.net/ubb/Forum5/HTML/000035.html (http://www.aota.net/ubb/Forum5/HTML/000035.html)
http://crystalking.com/cgi-bin/randtxt.pl/tester.htm/
3) That should be: http://crystalking.com/cgi-bin/randtxt.pl/tester.html
I have gone ahead and made the changes ( backup of course http://www.aota.net/ubb/wink.gif )for you, as this was relatively simple to fix...
--
Terra
sysAdmin
FutureQuest
------------------
www.FutureQuest.net (http://www.FutureQuest.net)
--FutureQuest goal: (10x+8y)/(x+y)=9.99--
--The best way to predict the future is by inventing it--
[This message has been edited by ccTech (edited 01-02-99).]
Javier Mosqueda
01-02-1999, 03:20 PM
VERY GOOD http://www.aota.net/ubb/smile.gif Terra/Deb
I had seen the first CRLF at the top but I don't know Perl and it came like that from the creator (I'm giving them feedback on that). The .HTML extension I changed before your reply trying to test that the CGI wanted an .HTML instead of a .HTM file. Now the conclussions for the documentation:
1.- The CGI runs great using a separate file with the database of messages, quotes or any HTML code one wants to paste at any web page.
2.- The creator says that the script can process messages embedded in the same HTML but I tried both options:
testol.htm is the html with the embedded database located at my /www/ directory (the script doesn't work properly with this embeded info)
tester.htm is the html without the embeded database, just the "command" needed for the script: "!random tester.dat", where tester.dat is the separate file containing the list of messages to be displayed randomly. (located at /www/)
randtxt.pl is the perl script located at the CGI-BIN directory with the $email and $base clauses pointing to my e-mail address and my /www/ directory respectively, no CRLF at the top http://www.aota.net/ubb/wink.gif.
You guys can now try it running at my web site crystalking.com (http://crystalking.com) , I've placed a set of "links" on the left with yellow dots, the one at the bottom says "phrase of the day". Clicking on that one, will show you the script running. Every time you refresh the page (F5 or refresh button of the Web Browser, PLEASE DO IT, CAUSE I'VE PUT A PICTURE TOO AND 4 MESSAGES IN SPANISH) the CGI will show random quotes taken from the separate database tester.dat.
3.- The a) links shown in my web site, b) date and time at the top and c) copyright or footer info, are made with SSI. The links and copyright info are kept in separate files links.txt and company.txt to quickly update all the site's pages by just changing those 2 files.
4.- Perhaps if you like the RANDTXT.PL after testing it, you could integrate it to your set of tools. I found it in the free scripts you suggested above and just says to not forget the creator.
Great tools FQ.!! THANKS
------------------
Javier Mosqueda
crystalking.com (http://crystalking.com)
[This message has been edited by Javier Mosqueda (edited 01-02-99).]
vBulletin® v3.6.8, Copyright ©2000-2013, Jelsoft Enterprises Ltd.