coffeecup Posted July 7, 2009 Share Posted July 7, 2009 I did place into an existing XHTML doc some PHP code as hand typed from source W3C school. I am using TextMate. I did change the file suffix of the pre existing XHTML doc from dot html to to dot PHP. I did place this re configured doc into MAMP ht docs along with the CSS doc. results: zero I did look into ( if ) i needed to put in place a meta , zero information after several hours of looking with many combo word searches. file suffix ???? html dot php or maybe php dot html i have not a clue. TextMate ???? do i need to create the whole doc DTD and all in a pre defined PHP doc, even though TextMate is a plain text doc i would assume there is zero absolutely zero encoding , but then why all of the options of doc types. Where did i go wrong. what could i do with the many possibilities. how could i make the PHP code do its thing inside of a XHTML doc in MAMP using TextMate thank you Quote Link to comment https://forums.phpfreaks.com/topic/165077-php-inside-of-a-existing-xhtml-doc/ Share on other sites More sharing options...
wildteen88 Posted July 7, 2009 Share Posted July 7, 2009 If you're running the sample PHP code from W3CShool locally. Then all you need to do is open your plain text editor and paste the code into a new file. Save the file as filename.php (change filename to whatever you want to call your file) and place it MAMP's htdocs folder. Now open your browser and go to http://localhost to run your .php files. EDIT: You wont be able to place PHP code into .html files unless your Server is confiigured to do so. By default only .php files can contain PHP code. Quote Link to comment https://forums.phpfreaks.com/topic/165077-php-inside-of-a-existing-xhtml-doc/#findComment-870478 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.