Html files with included php: related files, code color?

Hi there,
Wow, what an active forum!
I have two questions about html files that include php.
Almost all my html files have this structure:
<?php
(php stuff)
require_once 'somefile.php';
?>
(html stuff)
My first question is, is there any way for DW CS4 to display the files included this way? At the moment, they don't show up in related file view.
My second question is, is there any way for DW CS4 to display the html and php code in the file in a pleasant way? The php is not red as it is in pure php files.
Definitely not wanting to change the way I code or to change the file extensions...
Instead, wanting to change the SW settings to make my work easier.
With gratitude,
Smiles
Andy

Hi Brad,
Thanks for your reply!
> The PHP coding in a regular HTML page likely won't even work in a  browser
That's a standard coding technique...LOL... Maybe I didn't explain correctly...
My hundreds of pages validate XHTML transitional...
You are quite right that browsers do not interpret php code, but the  browser never sees php code.
I will try to explain again
The html file starts with <? php (code> ?>
When the browser calls the html file, the server knows to process the file as php.
It processes the php, then returns some html headers, and follows up with all the html that is after the <? php (code> ?> section.
Thousands of php coders work like this.It's a very efficient way of building a modular website while keeping html extensions.
By the way, related files already show in CS4 if they are in the html code.
Are you 100% sure you are correct about the CS5 inclusion situation? You won't know unless you have built an html file that looks like this.
<?php
require_once 'myfile.php'>
?>
<body>
hello html
</body>
Your myfile.php might look like this:
<?php
echo 'hello php <br />';
?>
If you have never used php in an html file, you will probably need to add something like this to your .htaccess file:
AddHandler application/x-httpd-php5 .php .htm .html
It tells your server that php processes not only php files but also html files.
Warmest wishes to all,
Andy

Similar Messages

  • How to send HTML mail with images multipart/related message

    Hi,
    Could any body tell me how to send HTML mail with images in "multipart/related" message,if any body can give the code ,it would be helpful.
    Thanks

    Hi,
    Could any body tell me how to send HTML mail with
    ith images in "multipart/related" message,if any body
    can give the code ,it would be helpful.
    ThanksHi!
    Refer to
    http://developer.java.sun.com/developer/onlineTraining/JavaMail/index.html
    I've found it very helpful.
    Look at the last part for a code showing how to send HTML mail!
    Regards

  • Problem with include and relative path in jsp

    Precompile jsp with wlappc in 9.2, I got the error "The include file was not found" when the jsp use <%@ include file="../includes/dataEntry/code_error.html" %>
              This code used to work with 8.1. I notice that someone has report the same problem with 9.0 and you have patch for it. Is it fix in 9.2 or do I require a patch as well?
              Thanks,
              Khuemy

    When you precompile, can you say "Keepgenerated=TRUE". It might help you track
              down the difference with the URL. You should only get a 404 error when the
              resource is not found at runtime, which is independant of when you compile. The
              difference should be in how the URL is compiled.
              Chris
              ali wrote:
              > I am using WLS 6.0 SP1, when I use relative path in <jsp:forward> in my JSPs
              > it forwards ok if I am using directly JSPs but if I am using pre-compiled
              > JSPs (and have proper servlet-mappings
              > in my web.xml), I get 404 error with the relative-path, if I change it to
              > absolute path with pre-compiled JSPs it forwards ok , then.
              > any ideas why this is so?
              > thanks,
              

  • OutLook not previewing html files

    OutLook quit providing a preview of my html files (only) about a month ago.  All other files preview okay.  Any suggestions on how to get it working on all files like it used to?

    RICH POW posted in macromedia.dreamweaver
    > I am trying to add includes to pages for a site hosted
    on an
    > Apache server that have the file extension .html but I
    don't want
    > to change any file names to .php.
    Is includes the one and only reason you're using PHP? And is
    there no
    PHP code in any of your files other than include()?
    If the answers to both questions is yes, then, assuming your
    server
    supports SSI, I recommend using simple SSI includes. (You may
    need to
    change your files to .shtml or set up the server to work with
    .html)
    If you are using other PHP code, there is a way to configure
    Apache to
    pass .html pages through the PHP interpreter. Not generally
    recommended
    if you have a lot of static .html pages with no PHP in them.
    > All works fine live, but Dreamweaver does not preview
    the
    > included file: <? include('includes/test.html');
    ?>
    To view Web pages with PHP in a browser, the pages must be
    processed
    through a Web server configured with PHP. You may need to set
    up a test
    server on your machine.
    Note: If you really are using PHP anywhere, you should not
    use short
    tags. Use <?php include('includes/test.html'); ?>
    > Is there any reason I should not include both an .asp
    type
    > include and the .php version as a workaround? Like this:
    > <? include('includes/test.html'); ?>
    > <!--#include file="includes/test.html" -->
    >
    > Is this bad practice or good lateral thinking?
    I would call it bad practice. Assuming you've set up your
    server to
    pass .html files through the PHP interpreter - AND the server
    processes SSI with .html, you will probably end up with two
    copies of
    test.html.
    Mark A. Boyd
    Keep-On-Learnin' :)

  • Dreamweaver CS6 and Coldfusion 9 - Syntax Errors & Code Coloring

    I recently purchased Dreamweaver CS6. 
    Also, I'm running Coldfusion 9 on Windows 7, but that's probably irrelevant.
    The issue is that Dreamweaver keeps on marking my files with syntax errors, and the code coloring gets all messed up.
    For instance, such function would indicate an error due to the #var#:
    <cfoutput><script>functionXYZ(#var#);<script><cfoutput>
    But this would work just fine:
    <script>functionXYZ(<cfoutput>#var#<cfoutput>);<script>
    The issue is that I have entire pages wrapped in cfoutput, redoing everything would take months.
    Or this would break the code coloring for the entire select as such:
    <select <cfif test eq 'test'>class="test"</cfif> name="selectbox">
    While this breaks the code coloring for the closing cfif as such:
    <select class="<cfif test eq 'test'>test</cfif>" name="selectbox">
    I'm getting syntax errors on thousands of my files, I understand that I could rewrite the code slightly to remove some of the error indications, but these are not actual errors so I feel that there is no point of me spending months updating the code.
    Is there a patch that I can apply so that this would work without any of these issues?
    Can someone please help?

    Have you posted this question in the Cold Fusion Forums?
    http://forums.adobe.com/community/coldfusion
    I don't use CF myself and the few CF coders I know have long since moved to Eclipse/ColdFusion Builder. 
    Nancy O.

  • Saved as HTML only file, but open as notepad with a lot code. In other words, it is not HTML file format.

    I saved a file as HTML only. When I am going to open this file, I found the file showed a notepad icon. When I opened the file, it was totally code description with some words inside. It looked like program work showed up.
    I checked it again and saved it again with HTML only again. It was the same situation.
    I would like to have help.
    This computer I just brought and downloaded Firefox only several days ago. I never had this kind of problem on other computer
    Thank you for the help

    Can you post a short except of the file, so we can see what is looks like?
    You can paste the text between &lt;code&gt; and &lt;/code&gt; tags.
    If you save the page as an HTML file then you should get the page source with HTML tags like you see if you right-click on a web page and select View Page Source in the right-click context menu.

  • Use PHP code coloring in HTML files

    In Dreamweaver CS3, what changes do I need to make to get PHP
    code coloring show up in .html files?

    robot88888888,
    First, copy this file from the app config folder:
    C:\Program Files\Adobe\Adobe Dreamweaver
    CS3\configuration\CodeColoring\PHP.xml
    To the user config folder:
    C:\Documents and Settings\[username]\Application
    Data\Adobe\Dreamweaver
    9\Configuration\CodeColoring\
    Then open PHP.xml in your favorite editor. You need to add
    HTML to all
    of the doctype lists Change every occurrence of this:
    doctypes="PHP_MySQL"
    to be:
    doctypes="PHP_MySQL,HTML"
    Save and close. If DW is running, close it. Now restart DW.
    HTH,
    Randy
    > In Dreamweaver CS3, what changes do I need to make to
    get PHP code coloring show up in .html files?

  • Hi i have a learning HTML file with a data file include a swf files how can i open it in my ipad?

    hi i have a learning HTML file with a data file include a swf files how can i open it in my ipad?

    iPad do not support flash natively.
    Look in the app store, some browsers do support flash with limited functionality.

  • Having problems: can't open an html file with textedit to change code

    Hi. I have been trying to open up both my index.html and my Welcome.html files with textedit in order to change the HTML codes for them - but it doesn't seem to work. When I open them using text edit I still get a discomboblutaed form of the web page and no html codes. HOWEVER when I open them with Word I can get at the HTML code. Will changing the code in Word work or must I use textedit to do it? ULtimately does anyone know how to fix the fact that your web URL always gets redirected to the home page because of the index file. For Instance, my web site is www.zanzibarhotelbeach.com but when you type that in it redirects to the opening page www.zanzibarhotelbeach.com/Home.html which is a problem for when you want to submit your web site to be found on the net. Any help would be MUCH appreciated! Cheers!

    Give TextWrangler a try. It's a free editor by the makers of BBEdit and is very well suited for editing HTML.
    But as far as your URL in the window, unless you have URL forwarding with masking you will always get the page name at the end of the URL in the browser's window. That's just how it works. With masking you will only get www.zanzibarhotelbeach.com in every window of the site. BUT visitors will only be able to bookmark the first page of your site. My tutorial site, http://toadstutorials.info/ is set up that way.
    This thread discusses how the different domain name forwarding works:
    http://discussions.apple.com/thread.jspa?threadID=1164519&tstart=0
    OT

  • Help Editing code from a published html file with flash detection enabled from flash

    hi guys ive publish a html file with flash detection enabled from flash
    heres the code from the publish html:
    <!-- saved from url=(0013)about:internet -->
    <html lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>main</title>
    <script language="javascript"> AC_FL_RunContent = 0; </script>
    <script language="javascript"> DetectFlashVer = 0; </script>
    <script src="AC_RunActiveContent.js" language="javascript"></script>
    <script language="JavaScript" type="text/javascript">
    <!--
    // Globals
    // Major version of Flash required
    var requiredMajorVersion = 9;
    // Minor version of Flash required
    var requiredMinorVersion = 0;
    // Revision of Flash required
    var requiredRevision = 45;
    // -->
    </script>
    </head>
    <body bgcolor="#ffffff">
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <script language="JavaScript" type="text/javascript">
    <!--
    if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
         alert("This page requires AC_RunActiveContent.js.");
    } else {
         var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
         if(hasRightVersion) {  // if we've detected an acceptable version
              // embed the flash movie
              AC_FL_RunContent(
                   'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0',
                   'width', '800',
                   'height', '600',
                   'src', 'main',
                   'quality', 'high',
                   'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
                   'align', 'middle',
                   'play', 'true',
                   'loop', 'true',
                   'scale', 'showall',
                   'wmode', 'window',
                   'devicefont', 'false',
                   'id', 'main',
                   'bgcolor', '#ffffff',
                   'name', 'main',
                   'menu', 'true',
                   'allowScriptAccess','sameDomain',
                   'allowFullScreen','false',
                   'movie', 'main',
                   'salign', ''
                   ); //end AC code
         } else {  // flash is too old or we can't detect the plugin
              var alternateContent = 'Alternate HTML content should be placed here.'
                   + 'This content requires the Adobe Flash Player.'
                   + '<a href=http://www.macromedia.com/go/getflash/>Get Flash</a>';
              document.write(alternateContent);  // insert non-flash content
    // -->
    </script>
    <noscript>
         // Provide alternate content for browsers that do not support scripting
         // or for those that have scripting disabled.
           Alternate HTML content should be placed here. This content requires the Adobe Flash Player.
           <a href="http://www.macromedia.com/go/getflash/">Get Flash</a>
    </noscript>
    </body>
    </html>
    now since the default codes places my flash movie on upper left corner, ive made my own tables with the flash on it, how or where do i place this code to the upper codes?
    <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <th valign="middle" scope="col"><table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <th height="600" bgcolor="#333333" scope="col"><script type="text/javascript">
    AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','wid th','800','height','600','src','main','quality','high','pluginspage','http://www.adobe.com /shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','main' ); //end AC code
    </script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="800" height="600">
              <param name="movie" value="main.swf">
              <param name="quality" value="high">
              <embed src="main.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="800" height="600"></embed>
            </object></noscript></th>
          </tr>
        </table></th>
      </tr>
      <tr>
        <td height="30" bgcolor="#990000"><table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <th scope="col"><table width="800" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <th scope="col"><div align="left" class="style1">Copyright 2009 St. Paul of the Cross Parish. All Rights reserved.</div></th>
                <th width="400" scope="col"><div align="right" class="style1">Usage outside our permissions guidelines requires our prior written consent.</div></th>
              </tr>
            </table></th>
          </tr>
        </table></td>
      </tr>
    </table>
    Tnx in advance!

    Hi
    Can you tell me which version of dreamweaver you are using (and flash pro, if you have it), as the code you provided has element of a number of different versions (e.g. your js flash files are reasonably new, but your flash inserted into the html body is old, but with the cs3 version of flash player indicated!). Also the detect flash file is no longer required.
    PZ

  • Including static html file (WebServer)  with JSP (App server)?

    Hi,
    I want to know how can a static html file that runs on a Web Server (iPlanet) in a JSP that runs on an App Server (WebLogic 6.1).
    What would be the tag used and how the html file is referenced? Is there any other extra settings involved while integrating iPlanet with WebLogic 6.1?
    Responses are highly appreciated.
    Thanks and Regards,
    Madanlal.

    Web servers usually work with the MIME Types. In the mime type settings will determine how a request for a particular mime type is served. Usually HTML, JPG,GIF... are served by the web server itself. A JSP request will be forwarded to the APP Server for peocessing.
    The HTML and the image files need to be in a directory visible to the web server from the document root.
    See the files
    config\mime.types
    config\obj.conf
    under the web server installation directory.
    Refer to the web server's admin guide for more info.

  • Including  a servlet code within an html file

    I have an html file which should include the contents of a servlet. The html and
    servlet are reside on different webservers, otherwise I would have used JSP.
    I cant use JSP here. hope u will provide me a solution as soon as possible

    The best way of doing this would be to make the html page a jsp and use the jstl c:import tage.
    If it must be an html you could use the IFrame tabe:
    <html>
    <head>
    </head>
    <body>
    <IFRAME SRC="http://www.yahoo.com" WIDTH="800" HEIGHT="600" scrolling="auto" frameborder="0"></IFRAME>
    </body>
    </html>

  • Extension to Force DW to Recognize PHP in HTML files

    Hi there,
    I've got several sites that use PHP code blocks embedded
    within plain .html files. It's an apache server and I simply use
    AddHandler application/x-httpd-php in the .htaccess file to tell
    the server to parse them for PHP.
    It works fine for these sites where we don't want to change
    URLs by modifying filenames.
    However, Dreamweaver doesn't treat these PHP code blocks as
    PHP (with one exception, which I'll get to). Instead, it displays
    the code block as plain text, without code coloring or code hints.
    It also doesn't provide the "Insert > PHP Objects" option from
    the insert menu.
    I'd like to find a way to get Dreamweaver to treat the PHP
    code in these files properly, but I haven't found an extension that
    could do it.
    The one exception I mentioned above is with PHP includes.
    When I have a PHP include, Dreamweaver displays it as "Server
    Markup" in the properties box, without the filename selection or
    edit properties you get with an actual .php file.
    However, the "related files" bar does correctly show the
    included file (I'm using CS4), so on some level, DW seems to know
    that it is a PHP code block.
    I'm hoping this is either an existing extension that I wasn't
    able to find when I searched the libray, or that it's a
    functionality I could enable myself without an extension if I'm
    given the right direction to look.
    Anybody have any thoughts on this?
    Thanks in advance,
    Jade

    "spiderjade" <[email protected]> wrote in
    message
    news:gnsbfg$l7h$[email protected]..
    > I'm hoping this is either an existing extension that I
    wasn't able to find
    > when I searched the libray, or that it's a functionality
    I could enable
    > myself
    > without an extension if I'm given the right direction to
    look.
    http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16410&sliceId=1
    Massimo Foti, web-programmer for hire
    Tools for ColdFusion, JavaScript and Dreamweaver:
    http://www.massimocorner.com

  • Adding code-coloring to file with nonstandard extension

    I have PHP files that end in .ctp, which are basically HTML templates with PHP mixed in (as part of the Cake PHP framework). I'd like them to be parsed for code coloring the same way that the PHP files are, but the text is all black. Is there a way that I can tell Dreamweaver to parse it for PHP code coloring? I have already added ".ctp" to the list of file types that open in Code View using DW's Preferences.
    This is CS4.
    Thanks!

    Nevermind - I figured it out from here, you just have to edit an XML file to include the new extension that should be treated as PHP:
    http://kb2.adobe.com/cps/164/tn_16410.html

  • Dash Code additional HTML files

    Hi there.
    I recently started using Dashcode and it seems pretty nice. I have a problem though. I'm developing a custom project with a single index.html html file. I managed to add a new HTML file in the project by duplicating index.html and renaming it to about.html. However I couldn't make Dashcode to open about.html in the canvas. I can only see the html code in the source code window but in the canvas is still index.html.

    Hi David,
    Been looking through posts and this is the most relevant (I
    think). I have looked for the doctypes="MySQL" however I can only
    find doctypes="PHP_MySQL" <-- is this the one I should be
    changing?
    Also, the reason for me doing this is that I can't afford to
    change the .htm files to .php for ranking purposes. The problem
    with this is that as the file extension is a .htm dreamweaver does
    not (include) the php files as it would do for a true PHP file (as
    I have got the server to parse the htm's as php's). Is it possible
    to get DW to do the same and to treat my local copies of the files
    (htm's) as PHP's so that I can see the page? This would be a much
    better solution rather than me having to upload the files to the
    server to see what they look like.
    Thanks in advance and hope this doesn't appear to be
    hijacking the thread (i felt it entirely appropriate)
    Riteon

Maybe you are looking for

  • Question on advice on timing of when to submit hands on submission form

    In [http://www.oracle.com/education/certification] support-faq's the question (accessed as of time of this post) Q. Do I need to complete all the tests in my certification path within a set period of time or in a specific order?+Has the follwing answ

  • Google.co.uk will not open due to certificate not being recognised, help

    This Connection is Untrusted You have asked Firefox to connect securely to www.google.co.uk, but we can't confirm that your connection is secure. Normally, when you try to connect securely, sites will present trusted identification to prove that you

  • Drag and drop from Lightroom into Premiere doesn't work in Windows

    I recently switched from OSX to Windows and noticed that in Windows, I'm unable to drag and drop from LIghtroom into Premiere. In OSX, it worked fine. I do this a lot because it's a time saver. I basically use lightroom to find the photo or video cli

  • Issue with gamecenter?

    I updated my OS on my iPod touch 4th gen on a Mac,  I run off a windows xp professional laptop.  It did erase all my apps, music, etc. but thought it would not be a big deal since I had a backup on my laptop's external drive.  I was able to reload al

  • WSDL access from Jdev v11.4,

    Hi, We are trying to consume WSDL service ,and are giving url with ipadress something like this http://<ipaddress>:7101/JrnlInfo_JrnlGrp-Model-context-root/AppModuleService?WSDL we are getting the following error oracle.jdeveloper.webservices.model.W