html - Problems with getenv("QUERY_STRING") in C language -


I am a new member of this community, but it has been for a long time to solve my problems here, but Today it is time for me to express myself. I can not do any more now: P is okay, I have to do this: write an HTML form which will give me a name, surname, username, password and email, and then click on a button Submit with I would like to write a CGI with C language which welcomes the user's name and password and displays an HTML page with a welcome message. Otherwise it will display a sign-in page and the new user is stored in the XML file, from which I had already done DTD. Now my problem is (I think) that the CGI file is bad or I have bad settings.

The HTML form is:

   

I have now written in CGI:

  #include & lt; Stdio.h & gt; # Include & lt; Stdlib.h & gt; Zero main () {four * data, noam [50], cognomen [50]; Data = getenv ("QUERY_STRING"); // me // nome = "value" & amp; Cognome = "value" & amp; User name = "value" & password = "value" printf ("content-type: 'text / plain'; charset = 'us-ascii' \ n \ n"); Printf ("& lt; html> \ n"); Printf ("& top; gt; \ n"); Printf ("& gt; Title & gt; Benvenuto & lt; / title & gt; \ n"); Printf ("& lt; / head>"); Printf ("k & lt; body & gt; \ n"); If (data == NULL) {error in passing data to script from printf ("& lt; p> error! Form. "); } Other {sscanf (Data, "Num =% [0- 9A-GAA-Z] and Cognizem =% [0- 9A-GAA-Z]", And Nome, and Cognome); Printf ("& lt; H2> Benvenuto% s% s ", noam, cognomen); } Printf ("& lt; / body & gt; \ n"); Printf ("& lt; / html>"); System ("pause"); Return (0); }  

With this code, I am still not trying to store the data, but just trying to display a welcome message and check whether the CGI works . But I'm always getting a server error message that tells me whether the server may be overloaded or there is an error in the CGI file.

I am using XMPP, so I put the HTML form file in the HTDox folder and then it was named after expanding the source file in the CD-bin folder. CGI

I hope that you can help me solve this problem because it is the whole day, I'm hitting my head against the keyboard: DPS Sorry if my english is ever good If not):


Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -