/    Sign up×
Community /Pin to ProfileBookmark

using the cgi option

i want to use a cgi on the apache server!
i have this exe file taken from a thread i have posted on :

[URL=http://www.vbcity.com/forums/topic.asp?tid=95532&#RID298119]http://www.vbcity.com/forums/topic.asp?tid=95532&#RID298119[/URL]
i compiled to file to an exe and putted it in a test folder!
the file is used as a cgi, and when i try to access it like this :

[code=php] <SCRIPT>var xmlhttp=false;/*@cc_on @*//*@if (@_jscript_version >= 5)// JScript gives us Conditional compilation, we can cope with old IE versions.// and security blocked creation of the objects. try { xmlhttp = new ActiveXObject(“Msxml2.XMLHTTP”); } catch (e) { try { xmlhttp = new ActiveXObject(“Microsoft.XMLHTTP”); } catch (E) { xmlhttp = false; } }@end @*/if (!xmlhttp && typeof XMLHttpRequest!=’undefined’) { xmlhttp = new XMLHttpRequest();}xmlhttp.open(“GET”, “http://localhost/test/cgi4vb.exe”,true);xmlhttp.send(“x=asdfsadf”);xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { alert(xmlhttp.responseText) } } </SCRIPT>
[/code]

i recive a message with the letters “MZ” which i dont know why

is the place i putted the cgi is ok?should i put it on another place?
thnaks in adance
peleg

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceMar 15.2005 — Well, there are permissions you must set on the EXE to make it invokable from your PHP code. I don't know what these are, but that is my first guess. I also don't know about Linux, but Windows would require the EXE to be registered. This registration could either be a matter of placing it in the Windows System folder or, if an ActiveX Control, require REGSRV32 to be run on it. Also, it looks like you're trying to use JavaScript -- rather than PHP. Why are you asking in the PHP forum?

Otherwsie, what is the exact and full message text?
Copy linkTweet thisAlerts:
@mitconMar 15.2005 — Since he is working with .EXE files, I'm assuming he's on a Windows server with Apache. On Linux (or any *nix platform, I believe), Apache is controlled by the httpd daemon (correlates roughly to a service in Windows). That Daemon is controlled by a combo of the system rights and settings in the httpd.conf configuration file.

There are sections controlling folders, access rights and even valid file extensions (if I recall correctly). Unfortunately, my web server is so stable I usually do not have to do a lot of tweaking (it's been over 9 months since I've rebooted <g>). Sorry, for the vagueness of my answer, I usually have to rehash the details when I get in there.

I don't remember their names, but there are some nice graphical configuration front ends for Apache, unless you like to use Notepad (or vi if you are on Linux).
Copy linkTweet thisAlerts:
@DaiWelshMar 16.2005 — MZ are the first two bytes of any exe file (reason I did know but forgot, something geeky like initials of an early coder), so I am guessing your server is configured to download exe files rather than run them, at least in the directory you have it in.
×

Success!

Help @pelegk1 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...