0

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

<!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

while(!inputfile.eof())
{
string k;
getline(inputfile,k);
parse(k);
outputfile<<k<<endl;
}

Well, As i have not succeeded in getting my desired output. I wanted to ask whether anyone knows why this is happening?

4
Contributors
12
Replies
13
Views
7 Years
Discussion Span
Last Post by Sky Diploma
Featured Replies
  • 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. Read More

  • I wonder if somehow the C++ program is introducing an EOF character prematurely. I strongly doubt it's a crlf \n issue (that is linux uses a different mechanism for new lines than does DOS/Windows). If I'm not mistaken, in linux EOF is ^D, and in M$ I think it's ^Z.... … Read More

0

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.

0

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.

0

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.

0

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.

0

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............

0

Have you tried uploading it again? Tried uploading other files? This seems to have nothing to do with your C++ program.

0

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.

1

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.

1

I wonder if somehow the C++ program is introducing an EOF character prematurely. I strongly doubt it's a crlf \n issue (that is linux uses a different mechanism for new lines than does DOS/Windows). If I'm not mistaken, in linux EOF is ^D, and in M$ I think it's ^Z.... soooooooooo maybe there is an issue there... also, make sure it's not a permissions issue, though I imagine if it were, the web server would give you an error, other than a blank HTML.

0

Thank You Camatose And Death Clock. I have finally managed to figure out why my page wasnt displaying. It was because of a faulty piece of php code. So i guess my C++ worked properly ;)

I am absolutely sorry. To have made you all Perplexed with confusion.
I doubted my coding .. Which was not the appropriate to start over with.

When i switched on to display Php errors on the server. I caught a third party script which i was using had a messy but simple error.

Now it all works ;)

Thanks to you guys again .

0

Sorry for DOuble posting

Now i have another problem guys. Internet explorer 7 and Firefox both have given errors in the adsense scripts that i have posted and they say that there is a un-identified character that is being posted in the code.

here is a example of the website.

http://sim.byethost4.com/Golf.html

Clicky

Now i think that it is being caused by the program becoz of

outputfile <<s<<endl;

So is there anyway of getting rid of that?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.