does anyone know how to transfer inputted information from C++ program to an html file and how to go about doing this. ALso, if anyone has any examples, i would really like to see them.
Also need some tutorial sites on how to complete this task.
does anyone know how to transfer inputted information from C++ program to an html file and how to go about doing this. ALso, if anyone has any examples, i would really like to see them.
Also need some tutorial sites on how to complete this task.
?
if you know how to write html in a text editor you're half way there.
the other half is knowing how to output a text file. use ofstream. simple as that.
"You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter
i dont know, i just want to know how i can create a program which will transfer information from variables into a website and display it there.
Code:#include <fstream.h> int main() { ofstream WriteFile; WriteFile.open("MyHomepage.html", ios::out); int MyVar = 345; if(!WriteFile.fail()) { WriteFile << "<HTML>" << endl; WriteFile << "<HEAD>" << endl; WriteFile << "<TITLE>My homepage</TITLE>" << endl; WriteFile << "</HEAD>" << endl; WriteFile << "<BODY>" << endl; WriteFile << "<H1>Welcome to my homepage!</H1>" << endl; WriteFile << "My variable has the value: " << MyVar << endl; WriteFile << "</BODY>" << endl; WriteFile << "</HTML>" << endl; WriteFile.close(); } return 0; }
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
is there any other codes i have to know like how to input information onto the internet?
oh man, I know what you're after! HA.
Ok, there are two ways this is normally done. FTP and Frontpage extensions. For either you'll have to learn Winsock or WinInet. For FTP (the more likely) you'll need to learn the FTP protocol. I'm not sure but you sound like you might be a beginner and I don't suggest you try to do it this way.
Can anyone suggest if maybe FTP can be done commandline perhaps using system()?
edit: don't think that "beginner" stuff was meant to be insulting. It wasn't.
"You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter
i am a beginner, and i dont it as an insult because your always a beginner when you start new. I am greatful for your help. I would like to know the easiest way that this type of task can be done. That code above is great but looking for a bit more advanced piece encorporating the above code with a bit more flashier commands
perhaps it would help if you explain what you're trying to pull off here. I'm guessing sort of an html editor that will save up to the web?
"You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter
im trying to create a program where you can update information on a webpage through a C++ program. The site is not on the web, but i want it to be an html file. Like, I would like to add new information to a site, delete information off the site.
This means the site is on your hard drive? If that's the case you're just talking about writing out to a file as we mentioned before. The "template" for the thing can just be written out by the program as Magos has shown (I haven't exactly tested his code though)The site is not on the web
"You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter
what if it were write on the web, hot would it work
Flashier commands? Umm, not sure what you mean. If it's a nicer look of the page you're searching for, then you should learn HTML.Originally posted by niroopan
That code above is great but looking for a bit more advanced piece encorporating the above code with a bit more flashier commands
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
ok, like I said. if it's on your hard drive you just write it. but....
if you're trying to write to the web, you should write to your hard drive first and then FTP it up to the server. I think WinInet might be your best bet for writing it to the server.
"You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter
if i wanted the user to type in a paragraph, which contains a massive number of characters, how would i go about doing this.