Help - Search - Members - Calendar
Full Version: saving new file extensions
Movable Type Community Forum > Additional Resources > Tips and Tricks
Buckuxc
hey all,

   I am trying to learn how to code certain things, but I've already run into a snag that seems like it should be obvious. I am new at this, so it isn't that obvious to me. Making my first attempt at learning both php and how to use plugins, the tutorials say to create a file, copying and pasting the code they give you, and they save as the extension (in each case either .pl or .php). I made the assumption that I just use a simple text editor like Notepad for this, but when I "save as" the file, I get *.pl.txt or *.php.txt. What do I have to use to create and save files as these extensions (as well as others)?

sps
maddy
When you save something in Notepad, underneath where you type the desired file name there is a pull-down menu for Save as Type:, which defaults to Text Documents. If you change that to All Files (*.*), and then type your file name as file.pl, etc, the .txt will not be added on there. smile.gif

I hope that makes sense! smile.gif

Another Text Editor I like is EditPad Lite (Pro version). Love that unlimited undo/redo! biggrin.gif
Buckuxc
Just as an update to this, so that others having this problem can find help.  I read this somewhere (forget where), but the problem really had to do with my computer not recognizing the .php or .pl extensions.  To remedy this, go to View->Folder Options, which can easily be accessed by going into My Computer and looking at the menus.  In Folder options click File Types and click New Type.  Put in whatever description you want, the file extension (i.e., .php or .pl, etc.).  Then under Action, click New.  In this dialog box, type for

Action:  Open
Application used to perform action: C:\WINDOWS\Notepad.exe

This will allow the file to open up in the Notepad text editor. After this, just press Ok and Ok and you have a new extension with which to save files in Notepad. Of course, when you save, make sure to save it as *.php (or whatever extension) and save as All Files.  Hope this helps someone in the future.

sps
maddy
I usually just right-click the file and "Open With" selecting EditPad or NotePad (depending on my mood), but yeah, you can configure it to open automatically like that. smile.gif It's not necessary to configure your computer as you've done simply in order to save with that extention though, only if you want to automatcially open the file with that extension in a particular program. You can save with any extension you like (eg. mt.rocks), and then use the "Open With" option to open it in your text editor. smile.gif
Buckuxc
Unfortunately, my computer didn't agree with saving files as any extension.  No matter what, it would save Notepad files as .txt, added to whatever I called it (i.e., firstattempt.php.txt).  No matter how I saved it, this would happen. That's why I had to go through all of the messiness.  Perhaps there's another way, but my computer just plain refused to save something as the file extension I wanted until I did what I did.  I don't know, but I figured I'd at least post it for future reference.

sps
girlie
I just rename the files from inside of my FTP program before uploading them.  ;)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.