Jump to content

Recommended Posts

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

 

Link to comment
https://forums.phpfreaks.com/topic/165077-php-inside-of-a-existing-xhtml-doc/
Share on other sites

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.

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.