Click to See Complete Forum and Search --> : Problem editing PHP pages in Dreamweaver
mancroft
07-16-2003, 03:36 AM
Someone I am working with has been editing PHP pages in Dreamweaver which mucks up the PHP by, for example, changing <?php to <!--p or something similar.
Is it possible to successfully edit PHP pages in Dreamweaver?
jazappi
07-16-2003, 03:51 AM
Which version of Dreamweaver are you using?
I know in MX the integrated HomeSite Code Editor within Dreamweaver and it is setup to handle some PHP. You can also go into Edit --> Preferences and find the Code Format in that screen there is a tag library editor. You can customize code there so it doesn't reformat it.
Question is, Is it worth it? Nope. Go get HomeSite and edit them by hand coding, works better and you don't have to worry about that auto code monkey Dreamweaver had running around jacking up your code.
Peace!
Weedpacket
07-16-2003, 08:40 AM
Moving this to a manifestly more appropriate forum.
mzanimephp
07-16-2003, 08:49 PM
Originally posted by jazappi
I know in MX the integrated HomeSite Code Editor within Dreamweaver and it is setup to handle some PHP. You can also go into Edit --> Preferences and find the Code Format in that screen there is a tag library editor. You can customize code there so it doesn't reformat it.
Thats the hard way of solving this problem. DWMX has support for PHP so as long as your file has a ".php" extension it will not change your opening and closing <?php ?> tags.
The only reason DWMX will change your code is if it thinks you have bad HTML. So (in MX) go "Edit" > "Preferences" > "Code Rewriting" Tab > And Uncheck everything. Hit OK.
And just like that - it won't change your code again, ever. Even if it is bad code.
Originally posted by jazappi
Question is, Is it worth it? Nope. Go get HomeSite and edit them by hand coding, works better and you don't have to worry about that auto code monkey Dreamweaver had running around jacking up your code.
Question is, Is that a good idea? Nope. Not if your using DWMX. (Thats like throwing away your XBox and buying a Gameboy instead.)
If you are using DW4 or older then yes. Because DW4 and older was before they added support for PHP. Homesite is now owned by Macromedia and all future support for that now-dead program will be given BY Macromedia. Through Dreamweaver MX.
Go to (on OSX) Preferences ->Code Rewritting. Make sure .php is in the "Never Rewrite Code" field and check the box. DWMX will never rewrite your code. period.
DigitalDesign
07-17-2003, 07:23 PM
Is it possible to incorperate php into dreamweaver templates?
yes you can incorporate PHP in DWMX templates. but, my experience is that it's dicey.DWMX is unstable on OSX. So it crashes a lot when updating templates in a large site.
I use PHP includes instead.
mzanimephp
07-17-2003, 07:31 PM
Yeah you can do this. But sometimes if you have PHP above the <html> tag DWMX will remove it, so as I said earlier you have to turn off the code rewrite feature.
mzanimephp
07-17-2003, 07:35 PM
Originally posted by crag
yes you can incorporate PHP in DWMX templates. but, my experience is that it's dicey.DWMX is unstable on OSX. So it crashes a lot when updating templates in a large site.
I use PHP includes instead.
crag, what version of OS X do you have? I use DWMX templates on OS X and it never crashes on me. Then too, I suppose this all has to do with RAM. I've got about 760mb of RAM and it still seems a bit bulky and slows other apps down a tad when its open.
I'm running OSX 10.2 on a Dual PowerMac (Dual G4) with 1.25 GB RAM. DW crashes all the time. I get a JavaScript error or a whole slew of errors that end with an Out of Memory error. I've reported this on the MM usernet and all I get are people telling me to delete the temp direcotry (_mmServerScripts). This only happenes if I use DW to create recordsets and the like. Sometimes I end up having to recreate a page. So I've given on using DW for any PHP work. I write most of it. The errors are also scattered. Happen with different sites at different times.
mzanimephp
07-17-2003, 07:58 PM
Well you certainy have enough RAM then. Do you have OS 10.2.6? If not, that might help.
If you don't have the DWMX 6.1 update you might want to get that too. It fixes a whole slew of bugs. http://www.macromedia.com/software/dreamweaver/download/
Also, can you upload a page that causes your DWMX to crash? I want to see if I get the same effect and/or troubleshoot.
I have updated DW and I have 10.2.6. And yeah sure I'll upload a page.
Very straight forward page. All DW code and if I open the recordset in DW (using the bindings panel) I get:
Tyoe Error: patternMatch has no properties
and it degrades from there. I have to esc then quit. This does not happen all the time. But I don't get it, cause there are no no DW extensions on this page. just 3 queries that I applied in DW. This why I do everything by hand now. Which is better I think anyway. You won't be able to test this page unless i give you a table schema.. but here it is anyway: (attached)
mzanimephp
07-18-2003, 01:12 AM
Yeah, it looked fine to me. That's some advanced code - but I didn't see anything that looked screwy. I think there must be some kind of conflict in the SQL database which chokes DWMX.
Nope. besides the table having a lot of fields (I didn't design it) I don't see anything wrong either. I thinkk it has something to do with the DW connection to my testing server. But I can live with it. Like I said, except for recordsets most of the code is now written by hand.
thanks for looking...
PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved.