School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,096 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,013 people online right now. Registration is fast and FREE... Join Now!




Help with c database used with website

 

Help with c database used with website

jbeme

3 Nov, 2009 - 07:21 PM
Post #1

New D.I.C Head
*

Joined: 30 Oct, 2009
Posts: 21



Thanked: 1 times
My Contributions
Simpler programs I hope can get accross what I am looking for.
CODE

<html>
<head>
<script language="javascript">
function calc() {
var x = document.statements.y.value * 7;
var total = document.getElementById("total");
total.innerHTML = x;
}
</script>
</head>
<form name="statements">
<tr>
<td align="center>enter your age<br>
<input type="text" name="y" size="15" onclick="calc()"><br>
button onclick="calc()">clicky</button><br>
<td> In cat years you are</td>
<td><span class="result" id="total"></span></td>
</tr>
</form>
</html>

takes user input and spits output. Made it simple while still showing the elements I need.

CODE

#include <stdio.h>
#include <stdlib.h>
int main()
{
    char ch;
FILE *fp;
fp=fopen("C:\\Users\\mine\\Desktop\\anothertest\\test\\extras\\run.txt", "w");
char x[10]="Fo Sho ya";
fwrite(x, sizeof(x[0]), sizeof(x)/sizeof(x[0]), fp);
fclose(fp);
fp=fopen("C:\\Users\\mine\\Desktop\\anothertest\\test\\extras\\run.txt", "r");
while (( ch = getc(fp)) != EOF)
{
    printf("%c", ch);
}
fclose(fp);
}


creates a file of the text that is input. Then spits it back out.

Now assume I wanted the website page to instead take input, then send that to the server to be saved in a C database how would I do that? Also how could I send it back through C to be read by the Website?

I want to do this on my own and do not want to use PHP or MySql or any other program if I can avoid it. If anyone knows of a turorial or a text book or could tell me how to do this that would be wonderful. I know how to use a structure tree with classes and layers(If that is the correct names) to create a pretty dynamic database. I set up a password system for a 3d poker game I created which includes preferences and would now like to move into connecting my website and c skills. I have learned mostly on my own. Just really stuck here so please help.

User is offlineProfile CardPM
+Quote Post


JackOfAllTrades

RE: Help With C Database Used With Website

3 Nov, 2009 - 08:40 PM
Post #2

I exist to Google your problems.
Group Icon

Joined: 23 Aug, 2008
Posts: 5,319



Thanked: 454 times
Dream Kudos: 50
Expert In: Being annoyed with lazy people.

My Contributions
I answered this in the C/C++ Forum.
User is online!Profile CardPM
+Quote Post

Closed TopicStart new topic

Time is now: 11/21/09 11:47AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month