943,703 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Marked Solved
  • Views: 1080
  • C++ RSS
You are currently viewing page 1 of this multi-page discussion thread
Mar 1st, 2009
0

C++ and Html Files

Expand Post »
Hi All,

I have taken up this home project just for my pastime.

My objective is to take a html file and then make a complete new webpage with a specific keyword.
It basically is a find and replace type of method where my existing file contains a specific keyword where my parser comes through and edits.

So my basic approach was to ;

1)Read the initial html file line by line and move them into a vector containing strings
2)Then use the parse function on the string and then paste the string into a file.

I have pretty much succeeded doing all the above. And it the created page looks fine on my computer.

But when i upload it into my server. nothing is visible and when i open it up with a html editor Only The First line which is a html tag

Quote ...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
Is visible.

The rest of the html doesnt seem to be displayed.

Here is a basic example of what i was doing

c++ Syntax (Toggle Plain Text)
  1. while(!inputfile.eof())
  2. {
  3. string k;
  4. getline(inputfile,k);
  5. parse(k);
  6. outputfile<<k<<endl;
  7. }
Well, As i have not succeeded in getting my desired output. I wanted to ask whether anyone knows why this is happening?
Similar Threads
Reputation Points: 673
Solved Threads: 125
Practically a Posting Shark
Sky Diploma is offline Offline
818 posts
since Mar 2008
Mar 1st, 2009
0

Re: C++ and Html Files

So what are you saying the page opens OK as a html on your local machine but not on your server?
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Mar 1st, 2009
0

Re: C++ and Html Files

Yes exactly. On my Windows Computer it opens correctly. Apart from some scripts which arent running. But when i put it onto my server the whole thing is just dissapering

my host is byethost.com in his free pack.
Reputation Points: 673
Solved Threads: 125
Practically a Posting Shark
Sky Diploma is offline Offline
818 posts
since Mar 2008
Mar 1st, 2009
0

Re: C++ and Html Files

Does your page try to run the .exe to generate the new page? Byethost disables the running of executables for some pretty important security reasons.
Reputation Points: 128
Solved Threads: 43
Posting Whiz
death_oclock is offline Offline
389 posts
since Apr 2006
Mar 1st, 2009
0

Re: C++ and Html Files

NO. I run the exe file manually and after the output file is created. I have uploaded it to the server.

I dont seem to understand whether it is the coding or the way which browsers read html.
Reputation Points: 673
Solved Threads: 125
Practically a Posting Shark
Sky Diploma is offline Offline
818 posts
since Mar 2008
Mar 1st, 2009
0

Re: C++ and Html Files

The browser wouldn't make a difference if you use the same one to view pages on you local server as on your byethost server. Have you looked at the html source of both pages? I use byethost myself and uploading a file has never done this.
Reputation Points: 128
Solved Threads: 43
Posting Whiz
death_oclock is offline Offline
389 posts
since Apr 2006
Mar 1st, 2009
0

Re: C++ and Html Files

Well Yes. If i check the source in my computer it completely is showing up . But when i check the source in the Server it displays Blank............
Reputation Points: 673
Solved Threads: 125
Practically a Posting Shark
Sky Diploma is offline Offline
818 posts
since Mar 2008
Mar 1st, 2009
0

Re: C++ and Html Files

Have you tried uploading it again? Tried uploading other files? This seems to have nothing to do with your C++ program.
Reputation Points: 128
Solved Threads: 43
Posting Whiz
death_oclock is offline Offline
389 posts
since Apr 2006
Mar 1st, 2009
0

Re: C++ and Html Files

Other files work. But the files generated by the program do not. i have been working on this from the past 15 hours or so to make it work. Uploading files clearing the cache and then again trying but, i just am unable to find the flaw.
Reputation Points: 673
Solved Threads: 125
Practically a Posting Shark
Sky Diploma is offline Offline
818 posts
since Mar 2008
Mar 1st, 2009
1

Re: C++ and Html Files

Try posting a sample file generated by your program. Off the top of my head, I can't think of anything that would cause this.
Reputation Points: 128
Solved Threads: 43
Posting Whiz
death_oclock is offline Offline
389 posts
since Apr 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: srand and while() problem
Next Thread in C++ Forum Timeline: Poisson Probability..





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC