Programmer pr le web en C?

Programmer pr le web en C? - C - Programmation

Marsh Posté le 13-11-2005 à 18:55:22    

Est-il possible de faire de la porgrammation en C pr le web?
en gros existe - t - il un module apache qui me permette de faire mes pages en c à la maniere de php par exemple?

Reply

Marsh Posté le 13-11-2005 à 18:55:22   

Reply

Marsh Posté le 13-11-2005 à 18:56:01    

CGI/C [:spamafote]
 
T'es un peu un pervers quand même :o


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r
Reply

Marsh Posté le 13-11-2005 à 18:58:46    

Merci bien.. j'espere que je vais trouver facilement.
Pouruqoi suis-je pervers? ^^

Reply

Marsh Posté le 13-11-2005 à 19:01:35    

Je ne trouve pas de site officiel... Il y en a un?

Reply

Marsh Posté le 13-11-2005 à 19:04:16    

De site officiel de quoi [:petrus dei]
 
CGI c'est un standard d'interface (Common Gateway Interface), tu pensais quoi [:petrus dei]
 
T'as choisi de faire du C, t'as le droit d'y aller à la bite et au couteau, amuse toi bien.


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r
Reply

Marsh Posté le 13-11-2005 à 19:20:08    

il y a une lib toute prete faite par le meme que celui qui fait gd http://www.boutell.com/cgic/ (premier lien quand on tape "cgi c" dans google)

Reply

Marsh Posté le 13-11-2005 à 19:34:42    

M*** j'avais pas vu.. dsl et merci à tous

Reply

Marsh Posté le 13-11-2005 à 23:15:33    

a noter que tu peux utiliser fastcgi http://www.fastcgi.com/ si tu veux coder un truc top hype et en C [:franck75]

Reply

Marsh Posté le 13-11-2005 à 23:18:01    

Sinon tu peux faire des plug ins pour php, c'est du bonheur [:petrus75]

Reply

Marsh Posté le 13-11-2005 à 23:45:54    

le cgi en asm çà doit aussi valoir son pesant de cacahuete http://www.freebsd.org/doc/en_US.I [...] nment.html
(le vilain utilise un tableau c'est vraiment revoltant !)

Code :
  1. ;;;;;;; webvars.asm ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;
  3. ; Copyright (c) 2000 G. Adam Stanislav
  4. ; All rights reserved.
  5. ;
  6. ; Redistribution and use in source and binary forms, with or without
  7. ; modification, are permitted provided that the following conditions
  8. ; are met:
  9. ; 1. Redistributions of source code must retain the above copyright
  10. ;    notice, this list of conditions and the following disclaimer.
  11. ; 2. Redistributions in binary form must reproduce the above copyright
  12. ;    notice, this list of conditions and the following disclaimer in the
  13. ;    documentation and/or other materials provided with the distribution.
  14. ;
  15. ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  16. ; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  17. ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  18. ; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  19. ; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  20. ; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  21. ; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  22. ; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  23. ; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  24. ; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  25. ; SUCH DAMAGE.
  26. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  27. ;
  28. ; Version 1.0
  29. ;
  30. ; Started:   8-Dec-2000
  31. ; Updated:   8-Dec-2000
  32. ;
  33. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  34. %include    'system.inc'
  35. section .data
  36. http    db  'Content-type: text/html', 0Ah, 0Ah
  37.     db  '<?xml version="1.0" encoding="UTF-8"?>', 0Ah
  38.     db  '<!DOCTYPE html PUBLIC "-//W3C/DTD XHTML Strict//EN" '
  39.     db  '"DTD/xhtml1-strict.dtd">', 0Ah
  40.     db  '<html xmlns="http://www.w3.org/1999/xhtml" '
  41.     db  'xml.lang="en" lang="en">', 0Ah
  42.     db  '<head>', 0Ah
  43.     db  '<title>Web Environment</title>', 0Ah
  44.     db  '<meta name="author" content="G. Adam Stanislav" />', 0Ah
  45.     db  '</head>', 0Ah, 0Ah
  46.     db  '<body bgcolor="#ffffff" text="#000000" link="#0000ff" '
  47.     db  'vlink="#840084" alink="#0000ff">', 0Ah
  48.     db  '<div class="webvars">', 0Ah
  49.     db  '<h1>Web Environment</h1>', 0Ah
  50.     db  '<p>The following <b>environment variables</b> are defined '
  51.     db  'on this web server:</p>', 0Ah, 0Ah
  52.     db  '<table align="center" width="80" border="0" cellpadding="10" '
  53.     db  'cellspacing="0" class="webvars">', 0Ah
  54. httplen equ $-http
  55. left    db  '<tr>', 0Ah
  56.     db  '<td class="name"><tt>'
  57. leftlen equ $-left
  58. middle  db  '</tt></td>', 0Ah
  59.     db  '<td class="value"><tt><b>'
  60. midlen  equ $-middle
  61. undef   db  '<i>(undefined)</i>'
  62. undeflen    equ $-undef
  63. right   db  '</b></tt></td>', 0Ah
  64.     db  '</tr>', 0Ah
  65. rightlen    equ $-right
  66. wrap    db  '</table>', 0Ah
  67.     db  '</div>', 0Ah
  68.     db  '</body>', 0Ah
  69.     db  '</html>', 0Ah, 0Ah
  70. wraplen equ $-wrap
  71. section .text
  72. global  _start
  73. _start:
  74.     ; First, send out all the http and xhtml stuff that is
  75.     ; needed before we start showing the environment
  76.     push    dword httplen
  77.     push    dword http
  78.     push    dword stdout
  79.     sys.write
  80.     ; Now find how far on the stack the environment pointers
  81.     ; are. We have 12 bytes we have pushed before "argc"
  82.     mov eax, [esp+12]
  83.     ; We need to remove the following from the stack:
  84.     ;
  85.     ;   The 12 bytes we pushed for sys.write
  86.     ;   The  4 bytes of argc
  87.     ;   The EAX*4 bytes of argv
  88.     ;   The  4 bytes of the NULL after argv
  89.     ;
  90.     ; Total:
  91.     ;   20 + eax * 4
  92.     ;
  93.     ; Because stack grows down, we need to ADD that many bytes
  94.     ; to ESP.
  95.     lea esp, [esp+20+eax*4]
  96.     cld     ; This should already be the case, but let's be sure.
  97.     ; Loop through the environment, printing it out
  98. .loop:
  99.     pop edi
  100.     or  edi, edi    ; Done yet?
  101.     je  near .wrap
  102.     ; Print the left part of HTML
  103.     push    dword leftlen
  104.     push    dword left
  105.     push    dword stdout
  106.     sys.write
  107.     ; It may be tempting to search for the '=' in the env string next.
  108.     ; But it is possible there is no '=', so we search for the
  109.     ; terminating NUL first.
  110.     mov esi, edi    ; Save start of string
  111.     sub ecx, ecx
  112.     not ecx     ; ECX = FFFFFFFF
  113.     sub eax, eax
  114. repne   scasb
  115.     not ecx     ; ECX = string length + 1
  116.     mov ebx, ecx    ; Save it in EBX
  117.     ; Now is the time to find '='
  118.     mov edi, esi    ; Start of string
  119.     mov al, '='
  120. repne   scasb
  121.     not ecx
  122.     add ecx, ebx    ; Length of name
  123.     push    ecx
  124.     push    esi
  125.     push    dword stdout
  126.     sys.write
  127.     ; Print the middle part of HTML table code
  128.     push    dword midlen
  129.     push    dword middle
  130.     push    dword stdout
  131.     sys.write
  132.     ; Find the length of the value
  133.     not ecx
  134.     lea ebx, [ebx+ecx-1]
  135.     ; Print "undefined" if 0
  136.     or  ebx, ebx
  137.     jne .value
  138.     mov ebx, undeflen
  139.     mov edi, undef
  140. .value:
  141.     push    ebx
  142.     push    edi
  143.     push    dword stdout
  144.     sys.write
  145.     ; Print the right part of the table row
  146.     push    dword rightlen
  147.     push    dword right
  148.     push    dword stdout
  149.     sys.write
  150.     ; Get rid of the 60 bytes we have pushed
  151.     add esp, byte 60
  152.     ; Get the next variable
  153.     jmp .loop
  154. .wrap:
  155.     ; Print the rest of HTML
  156.     push    dword wraplen
  157.     push    dword wrap
  158.     push    dword stdout
  159.     sys.write
  160.     ; Return success
  161.     push    dword 0
  162.     sys.exit


Message édité par manatane le 13-11-2005 à 23:49:29
Reply

Marsh Posté le 13-11-2005 à 23:45:54   

Reply

Marsh Posté le 14-11-2005 à 00:18:46    

le bagne

Reply

Marsh Posté le 14-11-2005 à 01:20:43    

Quel est le prog en c pour:
on a un tableau définit de 15 éléments, on doit succésivement diviser une somme par les éléments contenus dans ce tableau et retenir le résultat du chiffre inférieur à tout le reste.
merci de m'aider c'est pour demain.

Reply

Marsh Posté le 14-11-2005 à 02:36:15    

debwhity a écrit :

Quel est le prog en c pour:
on a un tableau définit de 15 éléments, on doit succésivement diviser une somme par les éléments contenus dans ce tableau et retenir le résultat du chiffre inférieur à tout le reste.
merci de m'aider c'est pour demain.


allez jte fais ton truc avant de me coucher :d  
Essaye de le comprendre, sinon ça sert à rien hein ;)
 
J'espère que j'ai bien compris l'énnoncé [:cupra]
 

Code :
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #define PAS 100
  4. #define PAS2 10
  5. int main()
  6. {
  7.     int i, tab[15];
  8.     float TA_SOMME, min, tmp;
  9. // Tu as ta somme de départ     
  10.     TA_SOMME = rand()%PAS;
  11.    
  12. // les 15 valeurs dans le tableau       
  13.     for(i=0; i<15; i++)
  14.              tab[i] = rand()%PAS2;
  15. // Au départ tu dis que le min est trouvé avec la 1ere valeur du tableau             
  16.     min = TA_SOMME / tab[0];
  17. // Ensuite tu boucles en regardant a chaque fois si le résultat est plus  
  18. // petit que l'ancien min, si oui tu l'échanges.     
  19.     for(i=1; i<15; i++){
  20.              tmp = (TA_SOMME / tab[i]);
  21.              if (tmp < min)
  22.                         min = (TA_SOMME / tab[i]); 
  23.     }   
  24.     printf("min = %f\n", min);
  25.     return 0;
  26. }


---------------
- mon feed-back
Reply

Marsh Posté le 14-11-2005 à 12:46:08    

Zipo a écrit :

allez jte fais ton truc avant de me coucher :d  
Essaye de le comprendre, sinon ça sert à rien hein ;)
 
J'espère que j'ai bien compris l'énnoncé [:cupra]


Ce que tu n'as pas compris en revanche, ce sont les règles qui demandent aux forumeurs de ne pas donner la réponse à toute demande de devoir, TP, etc...
1 semaine de TT


---------------
J'ai un string dans l'array (Paris Hilton)
Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed