kirbyweb Posted October 28, 2009 Share Posted October 28, 2009 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 More sharing options...
thescientist Posted October 28, 2009 Share Posted October 28, 2009 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 More sharing options...
kirbyweb Posted October 28, 2009 Author Share Posted October 28, 2009 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 More sharing options...
thescientist Posted October 28, 2009 Share Posted October 28, 2009 I can help, but just keep posting in this thread and other people will help as well. Link to comment Share on other sites More sharing options...
kirbyweb Posted October 28, 2009 Author Share Posted October 28, 2009 Can you teach me php though please. Link to comment Share on other sites More sharing options...
thescientist Posted October 28, 2009 Share Posted October 28, 2009 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 More sharing options...
kirbyweb Posted October 28, 2009 Author Share Posted October 28, 2009 I have tried to open the php in IE an Firefox.Since I found out I cannot, I need someone who can teach me php and help get me started.Email me kirbyfrogfan@gmail.com If possible use a gmail account. Link to comment Share on other sites More sharing options...
thescientist Posted October 28, 2009 Share Posted October 28, 2009 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 More sharing options...
kirbyweb Posted October 28, 2009 Author Share Posted October 28, 2009 This code is from someone just email me please. Link to comment Share on other sites More sharing options...
thescientist Posted October 28, 2009 Share Posted October 28, 2009 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 More sharing options...
kirbyweb Posted October 28, 2009 Author Share Posted October 28, 2009 What do you mean? Link to comment Share on other sites More sharing options...
thescientist Posted October 28, 2009 Share Posted October 28, 2009 1) open notepad2) go to file -> open3) browse to your files location on your harddrive4) click 'open' Link to comment Share on other sites More sharing options...
kirbyweb Posted October 28, 2009 Author Share Posted October 28, 2009 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");}?> Link to comment Share on other sites More sharing options...
thescientist Posted October 28, 2009 Share Posted October 28, 2009 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 More sharing options...
kirbyweb Posted October 28, 2009 Author Share Posted October 28, 2009 Not sure, just need help!!!! Link to comment Share on other sites More sharing options...
thescientist Posted October 28, 2009 Share Posted October 28, 2009 with what? Link to comment Share on other sites More sharing options...
kirbyweb Posted October 28, 2009 Author Share Posted October 28, 2009 I just want to learn php. Link to comment Share on other sites More sharing options...
kirbyweb Posted October 28, 2009 Author Share Posted October 28, 2009 Please can you teach me and we can start over? Link to comment Share on other sites More sharing options...
thescientist Posted October 28, 2009 Share Posted October 28, 2009 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 More sharing options...
thescientist Posted October 28, 2009 Share Posted October 28, 2009 and now I see all these questions have been asked and answered before : sigh:http://w3schools.invisionzone.com/index.php?showtopic=28308 Link to comment Share on other sites More sharing options...
justsomeguy Posted October 28, 2009 Share Posted October 28, 2009 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 More sharing options...
Distortion Posted October 28, 2009 Share Posted October 28, 2009 Kudo's for your patience. I'd have said ages ago.If he read 2 lines of the introduction on w3 he'd have almost all his questions answered. I really respect your patience. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.