Jump to content

Open Php


kirbyweb

Recommended Posts

How do I open php with a text editor?I do not want the fancy download stuff, just want to know how to do it with a text editor.I click on the document and do IE or Firefox with Firefox it opens blank, with IE it opens then closes and asks me to save or open the file, but the box that opens and asks me to save or open the file always freezes.Please help, thanks.

Link to comment
Share on other sites

web browsers will never show the php code within the <?php> tags of a web page document. If you right click on a live php page and view its source, you will not see the code. If you have a php page (say one someone sent you), opening it up in notepad will let you get access to all the code.you can open your text editor and then browse your pc to that file and it should open up. If you just double-click on it, it will naturally try and open in a web browser.

Link to comment
Share on other sites

web browsers will never show the php code within the <?php> tags of a web page document. If you right click on a live php page and view its source, you will not see the code. If you have a php page (say one someone sent you), opening it up in notepad will let you get access to all the code.you can open your text editor and then browse your pc to that file and it should open up. If you just double-click on it, it will naturally try and open in a web browser.
The person who is teaching me cannot really teach me, can you teach me?
Link to comment
Share on other sites

um....well, for starters, have you read the tutorials here? Do you have any books to or have you read? What have you tried to do so far?

Link to comment
Share on other sites

well, the distinction has yet to be made where this php file came from. Is it a live webpage or just something you made? A live page WILL HAVE NO VISIBLE CODE. you could open a self-made php file and even though without a server it won't do anything, you would at least be able to see all of the source code.

Link to comment
Share on other sites

as suggested before, have you tried opening notepad and browsing to the file and trying to open it? or have you right0licked on it and tried to choose open with?

Link to comment
Share on other sites

Yes it opens in a new tab but shows nothing, I have this code put in.<?phpswitch($_GET['action']){case 'testfunction': test_function(); break;}function Test_function(){if ($test==1)print "Ze test works!!!";elsedie ("Ze test isn't working");}?>
So you have been able to view it in notepad? Maybe I'm just tired but I'm starting to feel like this conversation is going around in circles. You did read my posts which would highlight one important matter in this situation: WEB BROWSERS WILL NOT EXECUTE <?PHP> CODE. Didn't we just go over this server-side subject in your other thread?
Link to comment
Share on other sites

Well, its not going to happen over night, and no one's going to do it for you. I'm getting pretty tired, so this might be my last post for the night, so here goes:As in the other thread, I told you how to run .php pages on your own computer. Take care of that. It's kind of important if you don't have a php enabled web host to test on.Secondly, read the tutorials here, and then ask some questions. It's a lot easier when you have specific questions about something in particular. You should really do a lot of reading though and then start trying stuff out.

Link to comment
Share on other sites

Kirby, you cannot run PHP code without a web server. Double-clicking on a PHP file isn't going to do anything, your web browser doesn't know what to do with PHP code. Only a web server with PHP installed will be able to execute the code for you. In order to run your page through a web server, in your browser the URL to your page must start with http://. If it starts with file:// or anything else it's not going to run the PHP code.If you want to learn PHP, the first thing is to either get a test server set up on your own machine or get hosting on a server with PHP installed. It's going to be easier to develop if you have a local test server. There are packages like WAMP and XAMPP that include a web server, PHP, and the MySQL database. If you installed one of those you would be able to use the web server to run PHP. Download either WAMP or XAMPP and read the installation instructions to see how to set up your files so that you can access them over HTTP.If you want a text editor, there's a link to ConTEXT in my signature, that's the one I use.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...