[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] CGI script i C



On Sun, 01 Apr 2001 15:34:50 +0200, Peter Gade Jensen wrote:

>dvs følgende er et lovligt CGI script?
>
>#include <stdio.h>
>
>main()
>{
>system("sudo proftpkill");
>}
>
>eller hva??? for jeg syn's sq ikke rigtigt det virker??

Check din apache error log -- du skal sende noget tilbage til serveren:


#include <stdlib.h>
#include <stdio.h>

int main(void) {
  int res = system("sudo proftpkill");
  /* headers */
  printf("Content-type: text/html\n");

  /* mark end of headers */
  printf("\n");

  /* body */
  printf("system() result = %d\n", res);

  return 0;

}


men hvorfor bruge C:

#!/bin/sh
sudo proftpkill
RESULT=$?
echo "Content-type: text/html"
echo
echo "system() result = ${RESULT}"



(utestet)


-- 
=======================================================================
<sslug@sslug>           Herlev, Denmark       Software Designer
<URL:http://www.andreasen.org/>       <*>         LASAT^WEicon Networks
=======================================================================


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *