Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

how to use C to write html

Posted on 1998-09-09
6
Medium Priority
?
207 Views
Last Modified: 2012-05-04
Not long ago, I saw a web page to teach how to use C to write HTML and JavaScript. He called this topic is
HTML-based interfaces with c.

I will give 35 points to who can show me the step by step
to use C and ADA  to create html and javascript.
The expert who give a little bit wrong answer will receive
    f or rejected. Aslo If the expert who can give me the perfect answer will recieve another extra points.
    Thank you !
0
Comment
Question by:tanc02
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 1

Expert Comment

by:slinky
ID: 1837513
You don't want much for your 35 points!
Anyway, you want to search for CGI and C
There are lots of places on the net with example code but before you start make sure you can put CGI programs on your Web server and that the compiler you have produces executables that can run on the machine on which your server resides.
0
 

Expert Comment

by:MicroSeyed
ID: 1837514
If You Give me 300 Points I will Tell You ... !!!!! May Only I Knew what you want !!
0
 
LVL 1

Expert Comment

by:slinky
ID: 1837517
Go to http://www.infoseek.com
In the search box type +CGI +C
you will get a list of hundreds of places that have the information you require
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Accepted Solution

by:
DavidME earned 80 total points
ID: 1837518
Yes, what you are looking for is to code a CGI (Common Gateway Interface) program in C.

Basically, the program runs on the web server. You need that the owner of the web server let you to put your executable to run, usually in a /cgi-bin directory or with a .cgi extension.

You have to ask permission because most ISPs won't allow you to run anything on their servers. An alternative is to get your own webserver, you'll need one at least for the testing.

You can call the program form the url: <A HREF="server.com/cgi-bin/program.exe">, or from a form <FORM NAME="fFormName" ACTION="server.com/cgi-bin/program.exe" METHOD="GET">.

Then the program is run. It can receive the parameters from the command line (method='GET') or reading from stdin (method='POST').

Some important information such as where the clients are and where they came from is stored in environment variables.

The programming goes like this:
Having received your parameters and variables, you process them, you acces your data and read the files, databases or sensors or whatever you need and then you write to stdout the page that the client will recieve.
First you write the headers for the HTTP protocol, like this,
 printf( "Content-type: text/html\n");
then a blank line:
 printf( "\n");
the rest of the page:
 printf( "<HTML>\n\
<HEAD><TITLE>%s</TITLE></HEAD>\n\
<BODY>\n\
<P>%s</P>\n\
<P>%s</P>\n\
</BODY>\n\
</HTML>\n",
"Page title", szParagraph1, szParagraph2
);

 You could do it in any language that can read and write from standard input, Perl, shell script, .BAT files, C, C++, Pascal,...

 You get the idea, don't you?

Get an interesting C library to handle the usual chores from http://www.boutell.com/cgic/

http://echo.znet.de:8888/ shows the headers you are sending to the server.

For more information, search for "CGI" and "C" or get a book on "CGI programming in C".
0
 

Expert Comment

by:DavidME
ID: 1837519
I forgot to tell:

If you want to include Javascript in the result page, It's like writing any other code.

printf( "<SCRIPT>\n\
function fFunction( )\n\
{if( '%s'== vVariable)

}
0
 

Expert Comment

by:DavidME
ID: 1837520
I submitted too fast :)

If you want to include Javascript in the result page, it's like writing any other HTML code.

printf( "<SCRIPT>\n\
function fFunction( )\n\
{if( '%s'== vVariable)\n\
{alert( 'This is an alert');\n\
}\n\
}\n\
</SCRIPT>\n", szTheTextYouWantToCompareWith);

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question