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
Similar Messages
-
Hi I have download files using jZIP and then I can't find a program that will open them... they are .PHP and .html file extensions... what do I do.. Doug
Hello ,
Dear friend ''''' .PHP ''''' files are a server side pages or scripts it needs a server to run on it or to be executed , so you will have to install something like apache server you will find a great application that enables your system to work as a localhost server
>> http://download.cnet.com/XAMPP/3000-10248_4-10703782.html
but HTML file can easily opened by any browser like Firefox or IE
also if you need to edit the content of their code you will have to obtain a code editor like Notebad++
>>http://download.cnet.com/Notepad/3000-2352_4-10327521.html
thanks for your time i wish i could helped you. -
Dumb PHP ? How do I use PHP in .html files.[solved]
I've googled but I just seem to be missing it.
Could someone please point me to documentation or tell me what/how do I enable the Apache server to process inline php in .html files?
Last edited by FeatherMonkey (2008-03-25 16:51:21)http://www.desilva.biz/php/phpinhtml.html
Instead of using htaccess, you can just change httpd.conf.
Last edited by lucke (2008-03-25 16:02:56) -
Why does Dreamweaver upload a blank page when i "put" a .php or .html file that I just edited. It's like Dreamweaver isn't putting the complete file. So when i check my work (refresh the page), it is now blank. This happens about 50 percent of the time and can occur with any of the websites I maintain. (If I pull out my macbookpro, i can edit and upload the page, but the screen is smaller and i would rather be at my desktop). I am using CS5 on a MacPro, operating system 10.7.5.
I've never heard of that type of error before. If it were happening to me, here are a few things I would do...
Verify it's DW
Download Filezilla (free and very nice in reality) and make sure it uploads correctly from there to rule out connection issues
Rebuild Site Cache
From the Files window of your site, click the menu and go to Site > Recreate Site Cache
Delete DW File Cache
If the above does nothing, I'd kill my DW Cache File: http://forums.adobe.com/thread/494811
Uninstall, clean, reinstall
Uninstall the program, use the cleaner tool here: http://www.adobe.com/support/contact/cscleanertool.html to kill everything (Adobe leaves behind things that are picked up again in a normal uninstall/reinstall) then reinstall it. -
DW CS5 - PHP in HTML file - no display in DW live view
Have DW CS5, Local IIS 7 (Win 7 64x) testing server (Server Model: PHP MySQL) set up and working. External browsers render .html files with PHP fine (URL=http://localhost/testphp.html), DW Live View will not parse/display the PHP with ".html" extension. No ".htaccess" file, DW PHP Tag Library has all PHP "Used In:" boxes checked. Example:
Example 1
File name: testphp.php
<html>
<body>
<h1>Hello There</h1>
<script language="php">
echo "Hello World";
</script>
</body>
</html>
DW Live View and external browser URL: http://localhost/testphp.php:
Hello There
Hello World
Example 2
File name: testphp.html (same content as above, just filename extension changed)
<html>
<body>
<h1>Hello There</h1>
<script language="php">
echo "Hello World";
</script>
</body>
</html>
DW Live View:
Hello There
external browser URL: http://localhost/testphp.html:
Hello There
Hello World
How to configure DW CS5 to display PHP in DW Live View with file extension= ".html"?
Thanks in advance, have spent 2 days trying to accomplish!
SteveFile name: testphp.php
<html>
<body>
<h1>Hello There</h1>
<script language="php">
echo "Hello World";
</script>
</body>
</html>
This is not PHP code
The red code part should read as to be classified as PHP script
<?php echo "Hello World"; ?>
File name: testphp.html (same content as above, just filename extension changed)
<html>
<body>
<h1>Hello There</h1>
<script language="php">
echo "Hello World";
</script>
</body>
</html>
Apart from the same mistake as above, this file will not be recognised as containing PHP without the PHP extension. You can setup the server to accept HTML and to interpret same as PHP, but I would not recommend this.
DW Live View:
Hello There
external browser URL: http://localhost/testphp.html:
Hello There
This is amazing! With the code above? If you hadn't told me I would not have believed it. I tried it on my humble setup and you are correct. It works using the PHP file but not the HTML file. It doesn't matter, it is still not correct.
How to configure DW CS5 to display PHP in DW Live View with file extension= ".html"?
It is not up to DW to determine, it is the PHP server that determines whether PHP in an HTML file will be shown. Have a look here http://php.about.com/od/advancedphp/p/html_php.htm .Once again, I do not recommend this
I hope this helps.
Ben -
Syntax Coloring for PHP in HTML Files
I'd like consistent syntax color throughout my documents,
which can be CSS, HTML or PHP. However, when I write PHP code into
anything but a PHP document, it comes out in a single, or
dual-color format making it much less "pretty", and not nearly as
easy to read. HTML has CFM and ASP color options, but not PHP (and
I don't want to have to format the color twice in preferences
anyhow). I've tried grouping .html files in with the PHP/MySQL
color grouping in the DocumentTypes setting (Dreamweaver
8/Configuration/DocumentTypes), which works, but results in a crash
each time I do anything but look at a document.
Anyone experience this behavior, or better yet, have a
solution to make Dreamwever's syntax color consistent within
itself?
BWT, this refers to Dreamweaver 8.0.2, Mac OS X 10.4.7. And
the rest of the Studio is installed as well.jasonkenison wrote:
> I'd like consistent syntax color throughout my
documents, which can be CSS,
> HTML or PHP. However, when I write PHP code into
anything but a PHP document,
> it comes out in a single, or dual-color format making it
much less "pretty",
> and not nearly as easy to read.
Follow this link (watch the wrap), and scroll down to Randy
Edmunds' answer:
http://groups.google.com/group/macromedia.dreamweaver/browse_thread/thread/a60b556f59869a8 6/666ff112459275ec?lnk=gst&q=php+html+color&rnum=2#666ff112459275ec
He gives the details for Windows, but you should be able to
find the
correct file easily enough on a Mac.
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/ -
Can I force iTunes to recognize a iPhone backup file?
I accidentally setup my phone as a new phone and even though I can see my old backup in the directory, I cannot see it in itunes. Any Ideas on what the **** is going on?
Hi iDome90,
That screenshot was helpful, because I didn't have "Back Up" as an option. Check out this screenshot:
So I trashed my iTunes preferences
I went into my user preferences and trashed all my itunes-related preferences:
User>Library>Preferences... Anything beginning with "com.apple.iTunes".
I then reopened iTunes, and guess what? I now have the option to "Back Up". So I chose it, and a few minutes later, I now appear to have a backup of my iPhone!
A BIG THANK YOU!
Thanks to both kelseyaudrey and iDome90 for taking an interest and helping me solve this issue. I hope this thread will help others in the future.
Cheers,
Tina99 -
External editor used for CSS but not for PHP or HTML - why?
I've successfully configured Dreamweaver CS6 (trial) Mac to launch Sublime Text 2 when I double-click .css, js or .txt files in the Files panel. However, Dreamweaver refuses to open my .php or .html files in Sublime Text 2 - it always opens them within Dreamweaver.
Any thoughts how to overcome this? It's very frustrating.
Thanks!Hi Sudarshan,
I currently am on a Mac using Interarchy and BBEdit. In my new job they use Dreamweaver on PCs. I've tried Dreamweaver's code editor and it is clunky and dated. I won't be able to use BBEdit on the PC and by all accounts Sublime Text 2 looks like a good alternative and it is also available for Mac so I can have a consistent editing environment when working from home.
I have already tried what you recommended but it did not work. I will set back to the original settings and try again. I might try uninstalling/reinstalling.
Thanks for replying,
Adrian -
Is there an extension that forces the page to reload if the browser window has been resized?
Is there an extension that forces the page to reload if the
browser window
has been resized?check this out
http://www.irt.org/script/1625.htm
This may help you out.
The script is at the bottom of the page.
Zarir
"Rachael Caldwell" <[email protected]> wrote in message
news:e4b12e$ihi$[email protected]..
> Is there an extension that forces the page to reload if
the browser window
> has been resized?
>
> -
Browsers won't open some php testing server files
Running DW 8, OS 10.4.10, Apache virtual testing server with
php local site.
I've Firefox and Safari as primary and secondary browsers.
When working on a
page, if I select 'preview in primary browser', Firefox opens
the page with
my virtual url...no problem. Lately, some php files will not
open. Firefos
give a dialog to open the file in default (DW) or save to
disk. This is very
frustrating since one file it does this to is a login page.
Safari does the
same thing!
I have select the file in question in the finder (extension:
,php) and
through the Get Info and told Mac OS to open this file with
Firefox and all
.php extensions. Rebuilt prebinding so all php files in the
Finder show a
Firefox icon, but still neither Firefox nor Safari will open
them. They
don't recognize the
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1" />
Metatag. The really frustrating thing is that only some files
behave this
way. Most of the others work fine and I can't see anything in
the headers
that would cause one to open and not another. Has anyone ever
run across the
behavior before and if so, what was the cause?
Thanks,
Charles NewburyOn 10/14/07 10:18 AM, in article
[email protected], "Joe
Makowiec"
<[email protected]> wrote:
> On 14 Oct 2007 in macromedia.dreamweaver, Charles
Newbury wrote:
>
>> Running DW 8, OS 10.4.10, Apache virtual testing
server with php
>> local site.
>>
>> I've Firefox and Safari as primary and secondary
browsers. When
>> working on a page, if I select 'preview in primary
browser', Firefox
>> opens the page with my virtual url...no problem.
Lately, some php
>> files will not open. Firefos give a dialog to open
the file in
>> default (DW) or save to disk. This is very
frustrating since one
>> file it does this to is a login page. Safari does
the same thing!
>
> What happens on the actual server?
>
>> I have select the file in question in the finder
(extension: ,php)
>> and through the Get Info and told Mac OS to open
this file with
>> Firefox and all .php extensions. Rebuilt prebinding
so all php files
>> in the Finder show a Firefox icon, but still neither
Firefox nor
>> Safari will open them. They don't recognize the
>>
>
> Are you sure that your local server is running? Also,
I'm no Mac
> maven, but I'm given to understand that the version of
Apache which
> comes installed on Macs is on the underpowered side, and
should be
> replaced with a version downloaded from somewhere?
True, I'm running Apache 1.3, but I'm leery of trying to
upgrade to a newer
version for fear of messing up everything that already works.
Had a real
headache getting MySQL 5, PHP 5 and phpMyAdmin all up and
running with DW 8.
Fortunately I had David Powers book that gave pretty much
idiot proof
instructions on how to install all this stuff. I'd never been
able to do it
left to my own devices. Another caveat is that my webhost,
like most, is
behind the upgrade curve: they run MySQL 4.1 and phpMyAdmin
2,8 so if I
upgrade too much there may be compatibility issues.
Another oddity, renaming that file from .php to .html
extension causes it
to open fine in Firefox and Safari. I don't think it's kosher
to keep it
that way since it does contain DW8's login php scripts.
Again, there's no
problem with other .php files. -
"Could not complete your request because Photoshop does not recognize this type of file."
I am using the latest version of Photoshop CC. When I attempt to open a recent .psd file listed in the Open Recent list, I get the message "Could not complete your request because Photoshop does not recognize this type of file." I can use the open command to open these files with no problem. The files are not damaged or missing the .psd extension and open normally except when using the Open Recent menu. OS is Mac 10.8.5. Thanks for any clues as to a fix.
As weid as it may sound: simply don't use "Open recent...". Use Bridge to manage, find and start them in PS.
-
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
AndyHi 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 -
Dreamweaver CC, how to get php coloring inside html files
Before I could do it by changing the extension.txt file. Now when I try to change the file extension.txt I can't save it but I get an access denied error.
I am running with administrative privileges.
Any ideas?Sorry, I did not explain myself.
Before I used to be able to tweak the configuration file from DW (extensions.txt) and Dreamweaver would color the php code that was contained inside an html files.
I need the code coloring to apply in files with extension html.
I hope I am more clear now. And yes, @Rob Hecker2 you areright, I see now that it was very lousy explained -
DW CS5 - Can't save as .html file to .php
I have created html file and I want 'save as' to php. When the 'Save as' window appears I do not have the option to save to other formats, such as php.
My colleague has the same version but it is showing the option, I have expanded the 'Save as' window but I still do not see option. All I see is the 'Unicode Noramlisation Code' options.
Please helposgood_ wrote:
Just delete the .html extention at the end of the filename and add .php
...from the Files window in DW while your Site Defintion is chosen.
DW will update all of the links to file.php from file.html if you change the extension from within the Files window.
Aside from the extension, there is literally no difference between the file types, so simply changing the extension as osgood suggests will work. -
Is there a way on maxdb to force netbackup to use different initSID.utl fil
(This thread refers to a question that was posted to a blog and where the proper location to handle it is this forum)
Is there a way on maxdb to force netbackup to use different initSID.utl files ? I have try to do it with different bsi.env file . But if i start the backup it keep on asking for the default bsi.env file in /sapdb/data/wrk/SID directory . I have set the variable BSI.ENV to the new file but it looks like it ignore it. Its on a sun solaris operating system
Due to security reasons the DBM server process does no longer inherit environment variables from its caller, e.g. dbmcli.
see PTS 1155045, as especially in the area of external backup tools inheriting environment settings seem to be rather common.
Idea is to add BSI_ENV to the dbm.cfg file with a command like:
dbmcli -d ... -u ... dbm_configset BSI_ENV
For further information please refer to this documentation section
or for Backint also here
Best regards
JörgHi Jörg,
hmmm. I'd guess there are some problem with for which user the environment variables have been defined...
Anyhow, usually it's easier not to use the environment variables but to provide the dbm-server it's own runtime variables via dbm_configset.
Check the old thread archive_stage and archive_stage_repeat to different NSR_POOLs for an example application of this.
regards,
Lars
Maybe you are looking for
-
IMac is doing some weird stuff. Please help.
My iMac has been messing up the past couple days. I am on it right now and it's working perfectly fine aside from the fact I'm using an external monitor, but 99% of the time I cannot get on it. First of all the screen in my iMac does not work, it is
-
Why can't I copy and paste from google seach history with firefox 4
When I try and copy and paste from Google drop down search box nothing happens. Only happen with Firefox 4. I tried to roll back to 3.6 but every time i reboot it puts 4 back
-
Solaris 10 sparc service tag 1.0 download failing
Attempting to download service tag 1.0 for Solaris 10 sparc (Service Tag 1.0 distribution for Solaris 10 (zip), English) is resulting in below error: An error occurred while processing your request. Reference #50.37a2d740.1184190472.213ec99 Any ideas
-
For last few days, I am getting kernel panics few times a day. I have checked nothing has been updated in last few days. I am running Mavericks 10.9.4 on Macbook pro July 2011 edition. Can someone please help me with some pointers before I take it to
-
I can't open Gmail in Firefox. Used to work but now nothing.
It seems I am getting the same as others. Google works fine. Gmail works in Google but not in Firefox. Was OK but now get the error message; "Firefox has detected that the server is redirecting the request for this address in a way that will never co