fazlionline Posted February 9, 2009 Share Posted February 9, 2009 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 More sharing options...
webtrix Posted February 9, 2009 Share Posted February 9, 2009 Once you upload those php files to your server they will look just as same as your html files on your computer. PHP files have to be run on the web server. Link to comment Share on other sites More sharing options...
justsomeguy Posted February 9, 2009 Share Posted February 9, 2009 In other words, Dreamweaver does not understand PHP. Link to comment Share on other sites More sharing options...
fazlionline Posted February 11, 2009 Author Share Posted February 11, 2009 yesbut before writing this functioninclude()it is working, but after this not workingalso my page is index.phpif dreanvwaver do not understand PHP, then why index.php is working Link to comment Share on other sites More sharing options...
Synook Posted February 11, 2009 Share Posted February 11, 2009 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 More sharing options...
justsomeguy Posted February 11, 2009 Share Posted February 11, 2009 if dreanvwaver do not understand PHP, then why index.php is workingYou 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 More sharing options...
fazlionline Posted February 12, 2009 Author Share Posted February 12, 2009 Ok Dear,I got that Dreamweaver do not support PHP,What is the best program to edit my PHP files in? Link to comment Share on other sites More sharing options...
Synook Posted February 12, 2009 Share Posted February 12, 2009 DreamWeaver is fine! Just stop attempting to use design view... Link to comment Share on other sites More sharing options...
justsomeguy Posted February 12, 2009 Share Posted February 12, 2009 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 More sharing options...
damiancds Posted February 13, 2009 Share Posted February 13, 2009 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 More sharing options...
ColdEdge Posted February 13, 2009 Share Posted February 13, 2009 @ 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.