Forum Moderators: coopster

Message Too Old, No Replies

PHP newbie question

help with PHP

         

gemini181

3:17 am on Dec 1, 2005 (gmt 0)

10+ Year Member



Hi all, thanks for being here:

-How can I view a .php file in a WYSIWYG program (to update and improve HTML design), without needing to install PHP on my system?

Is this next question real difficult (for an "outsourced" coder with experience)?

-I want to "convert" a fairly simple 5 page site/ PHP script (all the pages are .PHP), into HTML templates with PHP "bits of code". This needs to be done without ruining a script that works well interacting with a database.

Any help would be great.
Thanks. :)

ogletree

4:16 am on Dec 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What I do is view the html in the wysiwyg get it right then cut and past it in notepad to work with the .php code. When I upload the page I can then see it.

gemini181

4:51 am on Dec 1, 2005 (gmt 0)

10+ Year Member



I had a .php page in Dreamweaver, the HTML elements didn't show. Do I change the file extension temporarily to .html, then switch it back later?

I can figure many things out with tutorials, but am looking to shorten my learning curve. Thanks.

wheelie34

11:49 am on Dec 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



changing .php to .html wont help, its the php code that wont run, I sometimes comment out all php then preview.

Or as above, just build your page first then add the php code to it after your happy with the looks.

vincevincevince

12:38 pm on Dec 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



-How can I view a .php file in a WYSIWYG program (to update and improve HTML design), without needing to install PHP on my system?

It depends on how you write your PHP. If it is in the form:


<html>
<head>...</head>
<body>
Hello <?=$name;?>, it's <?=date("r")?>
</body>
</html>

Then dreamweaver can open it without much problem (may need to add a file extension of .php for html.

If, however, it's written:


<?php
print
"<html>
<head>...</head>
<body>
Hello $name, it's ".date("r")."
</body>
</html>";

It's a lot more difficult, i.e. give up trying.

I find the most efficient method is to use a template system - either homegrown, or one like Smarty, which will allow you to edit the HTML in isolation from the PHP.