Jump to content

Dreamweaver & Php Layout


fazlionline

Recommended Posts

Hello DearI am using a registered version of Dreamweaver CS3. Everything is going good but I have a problem in PHP pages.My [index.html] file in looking goodhttp://www.aegp-af.com/beta/help/html%20page.jpgBut when I want same page in PHP, I just save my file “File> Save As” and [index.php], I is looking good in browser but on design layout it looks like this:http://www.aegp-af.com/beta/help/php%20page%201.jpgandhttp://www.aegp-af.com/beta/help/php%20page%202.jpgCan you please help me in this problem, why I am facing this?

Link to comment
Share on other sites

Dreamweaver understands PHP (as in it recognises the syntax), but it cannot render. If you think about this, it is logical, as includes are easy to parse, but other language constructs such as conditionals basd on input, objects, and such, are much more complex. Why bother - the result would not be consistent anyway.As I mentioned in my other post, WYSIWYG editors are useless when it comes to server-side scripting.

Link to comment
Share on other sites

if dreanvwaver do not understand PHP, then why index.php is working
You said yourself that it's not "working". Dreamweaver will open the file, sure, but it's not going to display it the same way it will look as if it was on a web server. PHP requires a web server to execute the code, and Dreamweaver is not a web server. Dreamweaver does not run the PHP code the way a web server does. At best Dreamweaver will just ignore it. At worst, it will see <?php ... ?> as an opening HTML tag and, never finding an ending tag, it will just hide the rest of the HTML content.
Link to comment
Share on other sites

You can edit PHP with pretty much any program, but I'm not aware of any program that will "display" the PHP code the way it will actually look on a server. When I develop, I use a text editor like ConTEXT and keep my PHP page open in a browser. When I edit it, I save the file in my text editor and switch to the browser and refresh.

Link to comment
Share on other sites

I think I understand where your coming from,what everybody else is saying is that you can use pretty much any text editor to create and edit php fileseven the old notepad should workbut I think what your asking for is a little preview of your page, (like just clicking on the .html file and it opening in your browser, not your editor)what you need is a local server set upjust about the simplest thing you can get is something called easyphp (google it and you should find it)when that gets set up (something that runs pretty much from the notification tray) you select local web and that'll give you a folder called "test" (or something close) you'll need to put your .php files in that folderand then run them from the internet that way (not really on the internet though it's still local to your computer, i believe)another option (which i think is a little better (it has mysql in it as well, and seems a little better setup) ) is wampserver (should be easier to find on google) if you install that and run it (it'll still be in the notification area) you'll want to put it online, then select "www directory" and copy your files you want to preview in there then run localhost, that'll bring up a page (in your browser) there's a projects section and a test folder (i believe "test 1234" by default) under that, your files should be in there and you'll be able to preview them that waylet me know if this wasn't clear enough,also, you might want to look into it, but i'm pretty sure that the tutorials mentioned that require is better to use instead of include()

Link to comment
Share on other sites

@ FazliOnlineLike every one sad PHP can be edited using simple programs like Notepad. The point that you are not understanding is that PHP is not a layout language PHP is a Server Side Scripting language just like ASP (Activer Server Protocol), JSP (Java Server Protocol), ASPX (Active Server Protocol Extra). PHP is just used same way as SSI (Server Side Include). Dreamwaver is a program design to make coding a web theme or and design easyers and to add codes in to it that will work on the server. The first time I saw PHP I new it was a Server Script. To show PHP on your Computer you need PHP insatlled on your computer, which will then execute the script in localhost. To do this you can download WAMP or just PHP. Before you go off asking this question why dont you read on the coding language first as of what I know W3Schools provides description of every coding language on there main website.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...