Jump to content

Recommended Posts

I'm trying to do a bulk find and replace for about 50 php scripts I've written, so I built a simple vb.net program to do the work. The problem is that when I upload the new files that have been outputted from vb.net, the format of the text is causing issues :

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent

 

the first 2 lines of the php script look like this:

 

<?php

session_start();

 

If I open the file in win_scp, delete the new line after php, and hit enter. Save the file, and it works fine.

 

I've done a little research on this, and found:

"encoding file type is UTF-8 without BOM."

 

How do I get my.computer.filesystem.writealltext(file,append, ENCODING)

to output files in that format?

 

My.Computer.FileSystem.WriteAllText(fi.Name, file_text, False, Encoding.UTF8)

isn't working. I still get the header errors from the php.

 

I know this is more a vb.net question, and I have already posted in a correct forum for that as well.

 

Still, any suggestions?

Thanks!

Nick

You still have copies of the original, pre-modified files, right? There are plenty of utilities that will do search/replace in many files. I wouldn't bother with trying to "fix" this issue and instead of getting the end results you need.

 

Here is just such a utility I used many years ago - so I can't comment on it's current viability:

 

http://www.softpedia.com/get/File-managers/Search-and-Replace-98.shtml

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.