?
Solved

how to use C to write html

Posted on 1998-09-09
6
Medium Priority
?
206 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
Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

 

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

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!

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
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…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses

765 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