Hey, i want to make some experiments with perl scripts, but i dont know anything about them, i just got some examples and as a programer i think i can make my way trough them, what i want to know is, lets say i have a file called hello.cgi, where should i put this file in my server? public_html/cgi-bin/? and how do i run it? lets say my domain is domain.com, so how do i call this hello.cgi? http://www.domain.com/hello.cgi? Thank you.
If it is in the cgi-bin directory then you would be calling it through the URL: http://www.domain.com/cgi-bin/hello.cgi Never forget, a website is organized as a directory structure. This can be real -- as in the directories actually exist on the server -- or artificially created to make URLs easier for people to grasp.
Can i do something like this : <?php include ("cgi-bin/hello.cgi") ?> Like, call the hellp.cgi in a php file?
try google to get basic information about CGI. You can write it on Perl, Python, PHP, SH, C and other languages. For example my first application for web was writtien on C++ (using Visual Studio) and running under apache on windows
You cannot do it as an include. If you want to call a perl file, you can invoke it from within a php script and then capture the output before delivering it to the viewer. You have two choices. Run it as if from the command line using the exec() or system() function call. Or open the cgi script as if it were a file. This was discussed in this thread http://forums.digitalpoint.com/showthread.php?t=139690 See the last post.