Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<!--#include virtual="/Captcha.asp"--> ??

Status
Not open for further replies.

turnbui

Programmer
Jul 23, 2005
60
GB
hello,
I am trying to get some asp working in Apache2.2 on Windows.
The instructions say to place this in the .html file where I want the CAPTCHA to be shown.

<!--#include virtual="/Captcha.asp"-->
<%Response.Write CreateCAPTCHA%>

Can someone explain what the purpose of the first line is for please as it looks like an .html comment to me?

Thanks
 
it's a server side include

ASP on Apache Hmm!

Is Chilli!Soft (Sun one or whatever it's called currently) or the Apache::ASP project installed on the server? Because Apache doesn't "do" ASP natively

BTW
Apache::ASP uses PerlScript so there is no response.write it would be $Response->Write($variable)

Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 

The only other possibility would be IIS serving ASP but front-ended by Apache (which passes the request onto IIS etc). A common implementation for windows web hosts, especially those with the plesk control panel.


A smile is worth a thousand kind words. So smile, it's easy! :)
 
Oh! no, don't say I've opened a can of worms here.
I'm attempting to implement a CAPTCHA from
I have finally got the SSI working on Apache on Windows now and my Perl.pl is working fine. However, the perlscript doesn't appear to work at all and for ASP I believe I need it??

<!--#include file="cgi-bin/iansCaptcha.asp"-->
<%Response.Write CreateCAPTCHA%>

the 1st line does now include the iansCaptcha.asp file but the second never starts the function in the included file CreateCAPTCHA even when I change it to what you described
<%$Response->Write(CreateCAPTCHA)%> or haven't I got the syntax correct?

So it looks like it might be Apache:ASP project you mentioned?
 

The script you link to is written in ASP VBScript (the most common scripting language of ASP).

I think you need to review your server technology implementation... what exactly are you using ?


A smile is worth a thousand kind words. So smile, it's easy! :)
 
Yes, well I'm new to this and thought I'd get a working script and learn from that once everything was hanging together. What I'm soecifically having trouble with is invoking the VBScript function in the included file [which does get included finally after getting SSI in .shtml files working.
I know less than nothing of VBScript but enough to know that the intention of this line:-
<%Response.Write CreateCAPTCHA%>

is to invoke the
Function CreateCAPTCHA()
On Error Resume Next
...
End Function

I have put this as the first line of the function

document.write ("<div>") & vbCrLf

to check if if it does in fact get invoked. As I see nothing on the browser or in the View|Source after browsing index.shtml I can only surmise that it is not getting invoked.

 

document.write ("<div>") = javascript
Response.Write CreateCAPTCHA = VBScript
$Response->Write(CreateCAPTCHA) = PerlScript

Decide which one you want to use, and use it, this crazy meddly of languages and technologies is going to make your life very difficult unless you fully understand how the execution pipeline/process works.

If you are running on windows, then I suggest you just use IIS, and if you want Apache to deal with the outside world, or give you extra functionality (like virtual hosts) then add it as a front end web server.

Apache::ASP is not really the best thing for a beginner to be using, and is really more focused on allowing ASP based on PerlScript to run on *nix environment.

If you want to run ASP and want to start with the standard scripting language (the one that 98% of all examples and downloadable functions are available in) then use IIS with VBScript.

If you want to use perl (e.g. cgi) , then you are better off looking at the perl and apache::asp forums for help.. as it is quite a different animal to normal classic ASP.

If you just want cross platform, then choose a different web technology.



A smile is worth a thousand kind words. So smile, it's easy! :)
 
I just expected the given code to work - stupid me. though to be fair it turns out that Apache:ASP is a bit more diffivult to install than everything alse.

more to the point did you see the ASP code in the browser source - Yes, I thouht I had mentioned this. So it means that the ASP install didn't go well.

I'll retry it. Thanks for your help much appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top