View Full Version : cgi scripts not working right with asp pages
gcapp
08-30-2002, 04:17 PM
I don't know if this is the right forum for this but does anyone know if cgi scripts will work in asp pages?? I have been using cgi scripts for some time now and I am trying to use them in asp pages that I am creating and the results of the scripts will not show in the pages I want. Instead the results show on a blank page (which is the default if the script can't find the correct page to display the information). With these cgi scripts you must place 3 "+++" on the page where you want the results to display. But for some reason the results can't find the "+++".
Here is an example.
If you go to this link:
www.enchantedmountains.info/asp/restaurant.asp (http://www.enchantedmountains.info/asp/restaurant.asp)
and select a city from the drop-down list you will see the results appear in a separate blank page instead of below the search box, where I have the 3 "+++" (you can't see them - they are in a white font)
If anyone has any answers for me, I would appreciate it.
Gary
Well.. on how i see youre trying to show asp templates in cgi script - this is completely wrong - your cgi script compiling under perl and going to server socket to client and it's never will be processed by active server pages. You have to define your page template in your cgi script to make it visible.
gcapp
08-30-2002, 10:23 PM
Inci,
I guess I'm not sure exactly what you mean.
Attached is the cgi script I am trying to use. You will see in section B1, B2, B3 is where I have to set the path for the data, where the script resides, the page in which I want the data displayed. Now the path to the page in which I want the data displayed is correct (section B3), at least that is where the page sits on my server. If there is something that should be in any of these three sections differently please explain.
In the script, the script is named restaurant2.cgi - I had to rename it here to restaurant2.txt for uploading purposes.
Or if there is something else I should do - I would appreciate it if you could explain it to me.
Any help you can give would be appreciated.
Thank you.
Gary
Hello,
As i see you want to be searched stuff to be displayed in your site template? But the damned thing won't work.. I have watched your attached file - but actually this wont solve the thing - you have to atach other file:
/websites/www.enchantedmountains.org/asp/restaurant.asp
I need to watch it., hopefully will help you then,
bye bye
gcapp
09-02-2002, 01:59 AM
Inci,
I have the correct file associated with the script. This file that is attached has a .txt extension because you can't attach a file with a .cgi extension in this forum. The file I have associated with the script is the restaurant.cgi script. Like I said, the problem is not with the script working (it does) it's with the display. It won;t display on the page I want. If you have an answer for that I would appreciate it.
Gary
Hello again..
yup i suppose the whole problem is with your template file:
/websites/www.enchantedmountains.org/asp/restaurant.asp
perl by itself cannot understand asp embedded stuff - so you must define top and bottom headers (your normal page layout must be splitted in two parts - top and bottom - then you will have to copy these parts in this file (/websites/www.enchantedmountains.org/asp/restaurant.asp
) - and you will get what you need (generated results will be put between top and bottom templates) - and this is the only way to do it.
all your page things like top and bottom HTML must be defined in this file without asp tags inside. perl cannot parse asp syntax by itself and asp parser will not be runed after the page is generated - thats for sure.
------------------------------------
your generated results source - top of the page:
---------------------
<%Session("GotFlash") = true%>
<!--#include file="global.asp"-->
<%
PageHeader = "Enchanted Mountains Region - Restaurants<"
%>
<!-- #include file=inc_header.asp -->
---------------------------------------------------
asp tags are NOT will be parsed by perl - so you must define real HTML syntax for TOP and BOTTOM parts
---------------------------------------------------
bottom of the page:
<!-- Hidden Counter
added by Gary Cappelletti -->
<!--#include file="Counter.asp"-->
<%
Counter_Increment(Counter_ThisPage)
%>
<counter name="Since Jan. 1, 2003" value="<%=Counter_Display(Counter_ThisPage)%>">
-------------------------------------------------------------------------------
must be removed too. - will not be parsed.
hope this will help you. bye bye
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.