Skip navigation
GSNet
Currently Being Moderated

Dreamweaver processing php in html page

Apr 2, 2012 5:20 AM

This is a question I have seen a lot in various sites but as of yet there is no real answer. How is it possible to have a page with a htm or html extension but get DW to add php content? And render any existing php content in the page?

Why do I need to do this? well making mobile sites and accessing pages in software like Edge only see htm pages so any existing sites I have made cannot be edited in such software or converted into apps thru applications like andromo (http://www.indigorose.com/products/andromo/)

Surely there must be a way to tell DW to treat htm page as php?

 
Replies
  • Currently Being Moderated
    Apr 2, 2012 7:18 AM   in reply to GSNet

    For the server to process PHP script, the file name must have a PHP extension and not HTM or HTML. DW is clever enough to detect the problem and refuses to co-operate until the problem is fixed.

     

    Gramps

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 2, 2012 7:37 AM   in reply to GSNet

    @GSNet That will make the server parse the php within the .html file but DW still won't treat it as a php page.

     

    I use apache rewrites to serve dynamic pages as .html, can you not just do something like that?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 2, 2012 7:41 AM   in reply to GSNet

    My apologies, that was very short sighted of me.

     

    Gramps

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 2, 2012 8:19 AM   in reply to GSNet

    It can do that but the PHP code hinting won't work that's all. If it's only the HTML you're editing then I guess that doesn't matter.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 2, 2012 12:12 PM   in reply to GSNet

    Is there some particular reason for retaining the HTM extension?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 3, 2012 7:22 AM   in reply to GSNet

    I apologize for annoying you with my question.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 3, 2012 7:47 AM   in reply to GSNet

    So my guess is that you have not thought about developing the pages in PHP, as they should, and renaming them for the purpose of applications that do not recognise the extension.

     

    Gramps

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 3, 2012 8:00 AM   in reply to Ben Pleysier

    As you discerned, that's where I was headed with my question which I can see was not clear.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 3, 2012 8:26 AM   in reply to Ken Binney

    I've been following this topic for a bit but haven't posted because I needed to get my head around what Andromo is.  Basically it's just like Phonegap, just without the support for the other operating systems.  If you are building an app you will not be able to use native PHP in your page with those builders from what I can tell because the App interface does not allow access to PHP because the content is run as if it is a local file.  So you would need to run the AJAX, JSON, or I've seen some posts on XUI to move the data to your server for the PHP to process.  The code is then executed by your server and sent back to the phone.  And I did some searching and there is even a post, albeit not very informative, in which a user asks this on the Andromo forums: http://support.andromo.com/discussions/questions/332-php-not-supported .

     

    The only part of this that I don't understand is how Edge is fitting into this because, I will admit that I have not used Edge extensively, but to my knowledge it does not support PHP and that all information gets passed in through AJAX, JSON because PHP is not part of the HTML 5 standard unlike Actionscript is to Flash because the open standard is set to support as many platforms as possible so it would work with .NET also.

     

    So to answer your question, as far as I know what you are asking is only possible from the server end and not something DW is programmed to do.  If I'm wrong in my understanding of what you are trying to do, please feel free to explain in a bit more detail what is going on, but as far as I can see there is no way to solve this issue.

     
    |
    Mark as:
  • Jim Carpenter
    509 posts
    Apr 6, 2006
    Currently Being Moderated
    Apr 3, 2012 8:28 AM   in reply to Ken Binney

    If this was my project, then I would proceed as Gramps states above. On my project I would give the file a php extension for working only. Once I have the page(s) working as I anticipated, I would then save as with the .htm extension so they would work in "Edge" or anyother software package that does not support the .php extension. GS, I am guessing that this is probably what you are doing currently. There are many ways to "skin" a page!

     

    Jim

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 3, 2012 8:43 AM   in reply to GSNet

    This free utility will rename hundreds of files in milliseconds

     

    http://www.1-4a.com/rename/

     

    HTH

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 3, 2012 8:51 AM   in reply to GSNet

    I apologise if my guess offended you.

     

    Have you thought of converting your data to an XML format and using a SpryXMLDataSet? This way you do not need the document itself to contain PHP.

     

    Gramps

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 3, 2012 9:01 AM   in reply to GSNet

    Have a look here http://labs.adobe.com/technologies/spry/samples/utils/query2xml.html to convert the data and here to learn about the data sets http://labs.adobe.com/technologies/spry/articles/data_set_overview/

     

    Once you understand the process, there is hardly any extra coding involved.

     

    Gramps

     

    PS. As an ex-lover of ADDT this should be familiar to you 

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 5, 2012 9:03 AM   in reply to GSNet

    With a cognac in one hand and a cigar in the other and 2AM it is very difficult to find an answer to what I regard as a statement rather than a question..

     

    Let me start by saying Spry is not dead!

     

    This will also answer your other post in the Spry Forum. The SpryDataSet is supreme, there is no alternative as yet until Mr Blas gets his proverbial into gear https://github.com/jblas/jquery-dataset

     

    The other apsect of Spry is the Validation which has not been surpassed. Spry is good. Stick with it, it will be continued in the next version of DW. Oops, not allowed to say. please keep this between us.

     

    Glad to see another ADDTer

     

    Gramps

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 5, 2012 9:29 AM   in reply to GSNet

    Perhaps we should team up and get Mr Blas to continue his good work.

     

    Fortunately jQuery does not clash with Spry, but it is the way to go.

     

    Gramps

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points